none
Repurpose Copy/Paste RRS feed

  • Question

  • Hello,

    I am writing a decentralized content tracker and would like to repurpose the copy command in word2010. I want it to attach a small tag to the copied text (can be additional text) that I can than fetch and remove when the paste command is used.

    Is that possible using c# and visual studio2010? Thanks for all the help!

    Kind Regards,

    Michael

    Tuesday, April 17, 2012 10:23 PM

Answers

  • Hi Michael

    Yes, you're getting very close :-)

    What's missing is that the method signature of myCopy isn't correct. Compare yours with mine:

       public

    void myCopy(Office.IRibbonControl ctl, ref bool CancelDefault)I get an error message if I try yours. Since you aren't, you should activate an option in Word in your test environment: Word Options/Advanced/General/Show add-in user interface errors

    Cindy Meister, VSTO/Word MVP

    Sunday, April 29, 2012 7:22 AM
    Moderator
  • Hi Michael

    I'm not sure I understand what kind of thing you want to add? Could you offer an example?

    In order to let the "real" command execute, set the CancelDefault parameter to false, then it will perform the action after your code is completed.

    Here's an example that puts some text in front of the current selection, extends the range to be copied to include that text, then copies that and removes the added text.

            public void myCopy(Office.IRibbonControl ctl, ref bool CancelDefault)
            {
                CancelDefault = true;
                Word.Range rng = Globals.ThisAddIn.Application.Selection.Range;
                Word.Range rngCopy = rng.Duplicate;
                object oCollapseStart = Word.WdCollapseDirection.wdCollapseStart;
                rng.Collapse(ref oCollapseStart);
                rng.Text = "Text at the start. ";
                rngCopy.Start = rng.Start;
                rngCopy.Copy();
                rng.Delete(ref missing, ref missing);
            }


    Cindy Meister, VSTO/Word MVP

    • Marked as answer by Rinmic Sunday, April 29, 2012 8:29 AM
    Sunday, April 29, 2012 7:59 AM
    Moderator

All replies

  • This article on Temporarily Repurpose Commands may help. You'd be looking at repurposing the commands with idMso="Copy" and idMso="Paste".

    Kind Regards, Rich ... http://greatcirclelearning.com

    Wednesday, April 18, 2012 1:26 AM
  • Thanks for the pointer. I tried to follow it, but I cannot recreate every step since I am using Visual Studio 2010, not 2005.

    I created the xml, as in the example:

    <?xml version="1.0" encoding="UTF-8"?> <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load"> <commands> <command idMso="Copy" onAction="myCopy" /> </commands> <ribbon startFromScratch="false"> <tabs> <tab idMso="tab1" label="Repurpose Command Demo"> <group id="MyGroup" label="My Group"> <toggleButton id="togglebutton1" imageMso="AcceptInvitation" size="large" label="Alter Built-ins" onAction="changeRepurpose" /> </group> </tab> </tabs> </ribbon> </customUI>

    And added the needed procedures in the Ribbon1.cs

    namespace WordAddIn1
    {
        [ComVisible(true)]
        public class Ribbon1 : Office.IRibbonExtensibility
        {
            private Office.IRibbonUI myRibbon;
            private bool repurposing = false;
    
            public Ribbon1()
            {
            }
            public void OnLoad(Office.IRibbonUI ribbon)
            {
                myRibbon = ribbon;
            }
    
            #region IRibbonExtensibility Members
    
            public string GetCustomUI(string ribbonID)
            {
                return GetResourceText("WordAddIn1.Ribbon1.xml");
            }
    
            #endregion
    
            #region Ribbon Callbacks
            //Create callback methods here. For more information about adding callback methods, select the Ribbon XML item in Solution Explorer and then press F1
    
            public void changeRepurpose(Office.IRibbonControl control, bool pressed)
            {
                repurposing = pressed;
                myRibbon.Invalidate();
            }
            public void myCopy(Office.IRibbonControl control, bool cancelDefault)
            {
                if (repurposing)
                {
                    MessageBox.Show("Copy command has been repurposed");
                    cancelDefault = false;
                }
                else
                {
                    cancelDefault = false;
                }
            }
            public void Ribbon_Load(Office.IRibbonUI ribbonUI)
            {
                this.myRibbon = ribbonUI;
            }
    
            #endregion
    
            #region Helpers
    
            private static string GetResourceText(string resourceName)
            {
                Assembly asm = Assembly.GetExecutingAssembly();
                string[] resourceNames = asm.GetManifestResourceNames();
                for (int i = 0; i < resourceNames.Length; ++i)
                {
                    if (string.Compare(resourceName, resourceNames[i], StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        using (StreamReader resourceReader = new StreamReader(asm.GetManifestResourceStream(resourceNames[i])))
                        {
                            if (resourceReader != null)
                            {
                                return resourceReader.ReadToEnd();
                            }
                        }
                    }
                }
                return null;
            }
    
            #endregion
    
    
        }
    }

    I also added the following code block to my AddIn class, as stated in the ribbon commentary

            protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
            {
                return new Ribbon1();  
            }
    


    No I am stuck. The re purposed command does not work yet and the help article states several steps including adding the xml as embedded recource and accessing the host application (Word) with the ribbon. I cannot follow these steps as the options are not available in my version of Visual Studio.

    I am aware this is a rather long post, sorry for that. I am very thankful for any help.

    Cheers,

    Michael

    Thursday, April 19, 2012 12:13 AM
  • Hi Michael,

    I use VS 2010 also and the problem is with the "repurposing" code. I use VB.Net but I took one of my callbacks for the Save control and ran it thru a converter to show you how it looks.

    public void ClkSave(Office.IRibbonControl control, ref bool cancelDefault)
    {
    	ThisAddIn.ClkedSave = true;
    	ribbon.Invalidate();
    	cancelDefault = false;
    }

    Hope this helps


    Kind Regards, Rich ... http://greatcirclelearning.com

    Thursday, April 19, 2012 3:06 AM
  • Hi Michael,

    Welcome to the MSDN forum!

    How is it going with the problem currently based on Rich's suggestion?

    You may refer to the following code. It simply uses inputbox to set tag for the text to be copied and is only available for the latest copy action. To store tags for each copy action, you may consider about using list or dictionary. 

            private IRibbonUI myRibbon;
            private bool repurposing = false;
    
            private string tempTag;
    
            public void OnLoad(IRibbonUI ribbon)
            {
                myRibbon = ribbon;
            }
    
            public void changeRepurpose(IRibbonControl control,ref bool pressed)
            {
                repurposing = pressed;
                myRibbon.Invalidate();
            }
    
            public void onCopy(IRibbonControl control, ref bool cancelDefault)
            {
                if (repurposing)
                {                
                    tempTag = Microsoft.VisualBasic.Interaction.InputBox("Enter the tag for the text", "Tag", string.Empty, -1, -1);
                    cancelDefault = false;
                }
                else
                {
                    cancelDefault = false;
                }
            }
    
            public void onPaste(IRibbonControl control,ref bool cancelDefault)
            {
                if (repurposing)
                {                
                    if (tempTag != null && tempTag != string.Empty)
                    {
                        MessageBox.Show("The tag for the paste text is:  " + tempTag + ".");
                    } 
    
                    cancelDefault = false;
                }
                else
                {
                    cancelDefault = false;
                }
            }       

    Note: Here the inputbox is not directly available in C#, we have to add the reference for "Microsoft.VisualBasic" library. 

    XML 

    <?xml version="1.0" encoding="utf-8" ?>
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="OnLoad">
      <commands>
        <command idMso="Copy" onAction="onCopy"/>
        <command idMso="Paste" onAction="onPaste"/>
      </commands>
      <ribbon startFromScratch="false">
        <tabs>
          <tab id="tab1" label="Repurpose demo tab">
            <group id="group1" label="Demo Group">
              <toggleButton id="toggleButton1" 
                            imageMso="AcceptInvitation"
                            size="large" 
                            label="Alter built-ins" 
                            onAction="changeRepurpose" />
            </group>
          </tab>
        </tabs>
      </ribbon>
      
    </customUI>

    Thanks.


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us


    Thursday, April 19, 2012 8:31 AM
    Moderator
  • Thanks Rich, thanks Yoyo!

    I am working on my PhD in New Zealand, therefore my answers might be delayed :).

    It seems my code is missing the following line:

    ThisAddIn.ClkedSave = true

    However, I cannot understand what this line refers to?

    @Yoyo,

    thanks for the advice, however I do not want the user to enter a tag, I want to automatically add a tag. This tag should than be fetched when the text is pasted, even if Word was closed after it was copied. Thats why the tag must be attached directly to the copied text. The simplest solution might be to just add a line of text to the copied text and fetch and delete it when pasted, if that is possible.

    Thanks for all the help,

    Michael

    Thursday, April 19, 2012 10:42 PM
  • You would replace that code with whatever you needed to do. As I said, I copied the routine from one of my actual programs so it had that statement. All I was done was trapping the Save click and setting a boolean value that I could use later in the program.

    Kind Regards, Rich ... http://greatcirclelearning.com

    Friday, April 20, 2012 3:19 AM
  • Hi,

    I finally found some time to look at the code again. I first fixed the name of the onLoad function in the XML

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
            public void Ribbon_Load(Office.IRibbonUI ribbon)
            {
                MessageBox.Show("Onload is triggered");
                myRibbon = ribbon;
            }

    which triggers now. However, the changeRepurpose or myCopy functions do not trigger, I checked with a message box at the beginning of the funtions. As I understand it, the functions should trigger whenever the copy command or button is triggered. I also tested the same functions with the idMso=FileSave command, but there is also no response when pressing the save button.

    I will try the VB code from the example tomorrow, but I'd really like to understand what I am doing wrong with the C# code :/.

    Should I open a new question to follow this up?

    Thanks for all the patience and help,

    Michael

    Tuesday, April 24, 2012 3:37 AM
  • Hi Michael,

    Would you please try with 

    public void changeRepurpose(Office.IRibbonControl control, ref bool pressed)

    instead of 

    public void changeRepurpose(Office.IRibbonControl control, bool pressed)

    Thanks.


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, April 24, 2012 5:03 AM
    Moderator
  • Hi Yoyo,

    sadly that did not work either :/. Since I tried your exact code, the error might be in the xml?

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
      <commands>
        <command idMso="Copy" onAction="myCopy" />
      </commands>
      <ribbon startFromScratch="false">
        <tabs>
          <tab idMso="tab1" label="Repurpose Command Demo">
            <group id="MyGroup"
                   label="My Group">
              <toggleButton id="togglebutton1"
                imageMso="AcceptInvitation"
                size="large"
                label="Alter Built-ins"
                getPressed="changeRepurpose"
                onAction="changeRepurpose" />
            </group>
          </tab>
        </tabs>
      </ribbon>
    </customUI>

    I am also unsure what this function in the ribbon1 class

            public Ribbon1()
            {
            }

    is supposed to do. It is called in the thisAddIn class, so surely something should happen.

    I also tried the VB example supplied in the tutorial, no effect either. I am suspecting that something is wrong with my developing environment. If someone could supply a confirmed working example for a repurposed command/button, I could check for this.

    Cheers,

    Michael



    • Edited by Rinmic Wednesday, April 25, 2012 1:05 AM
    Tuesday, April 24, 2012 10:48 PM
  • Hi Michael,

    If you tried my code, you have to replace the following xml :

    <command idMso="Copy" onAction="myCopy" /> 

    with 

        <command idMso="Copy" onAction="onCopy"/>
        <command idMso="Paste" onAction="onPaste"/>

    I have updated my first response with the whole xml. 

    Meanwhile, I have uploaded a demo project for reference:

    https://skydrive.live.com/redir.aspx?cid=37142ebae462f7f1&resid=37142EBAE462F7F1!141&parid=37142EBAE462F7F1!118

    You can download and try it.

    Please notice, you may have to install the add-in first before you debug the solution. Also, please set the start-up project first: Properties-> Debug -> Check "Start external program", browse the path for the WINWORD.EXE, for example:"C:\Program Files\Microsoft Office\Office14\WINWORD.EXE" on my computer. 

    Thanks.


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, April 25, 2012 3:49 AM
    Moderator
  • Hi Yoyo,

    thanks again for your continued support. I noticed that I need admin rights to install your demo setup or to build it. I'll now need to setup my dev environment on my 13 inch laptop, since my silly University does not give me admin rights on my dev machine. I'll let you know if it worked as soon as i am finished.

    The error when building the solution is:

    Cannot register assembly "C:\Users\mr97\Desktop\MR97PHD\PHD\Software\RibbonDemo\RibbonDemo\bin\Debug\Project1.dll" - access denied. Please make sure you're running the application as administrator. Access to the registry key 'HKEY_CLASSES_ROOT\RibbonDemo.Connect' is denied.    RibbonDemo

    Thank you,

    Michael

    Wednesday, April 25, 2012 10:21 PM
  • Hello,

       Any body found the solution? I am working on to Repurpose "FileSave" button. Followed all the steps, when ever user clicks on Word 2010's Save button the default SaveAs window is coming up first once you close or click Cancel button, my custom window is coming up. I wanted my custom window to show up all the time when ever the user clicks on Save.

    <customUI onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2006/01/customui">
      <commands>
        <command idMso="FileSave" onAction="OverrideSave"/>
      </commands>
    
      <ribbon startFromScratch="false">
            <tabs>
                <tab id="tab1" insertAfterMso="Add-Ins" label="Time">
                    <group id="group1" label="Time">
                        <toggleButton id="togglebutton1" imageMso="AcceptInvitation" size="large" label="Alter Built-ins" onAction="changeRepurpose" />
                    </group>
                </tab>
            </tabs>
        </ribbon>
    
    </customUI>
    
    
    public void OverrideSave(Office.IRibbonControl control, bool cancelDefault)
            {
                if (repurposing)
                {
                    MessageBox.Show("Override Default save");
                    btnTMSave_Click(control);
                }
                else
                {
                    MessageBox.Show("Not repurposed");
                }
            }
    
            public void changeRepurpose(Office.IRibbonControl control, ref bool pressed)
            {
                
                repurposing = pressed;
                ribbon.Invalidate();
            }
    

     
    Friday, April 27, 2012 7:04 PM
  • Hello Badribnath,

    I think you need to deactivate the standard function of the save button for your project. However, I do not know if this is possible.

    @Yoyo,

    I am still trying to run your code, however at the moment my new development environment on my laptop seems to be faulty, since add ins appear to be always inactive, even when run from visual basic 2010. I installed the addin through your supplied excecutable, this leaded to the add in being shown in Word2010 as active Add In. However, now message appears when copy is used.

    I installed (in that order)

    Visual Basic Ultimate 2010 (including .Net)

    Office 2010

    Any ideas what I missed?

    Thanks,

    Michael


    • Edited by Rinmic Sunday, April 29, 2012 4:14 AM
    Sunday, April 29, 2012 4:10 AM
  • Hi Badribnath

    <<Any body found the solution? I am working on to Repurpose "FileSave" button. >>

    Try also adding a command element for the ID FileSaveAs.


    Cindy Meister, VSTO/Word MVP

    Sunday, April 29, 2012 5:38 AM
    Moderator
  • Hi Michael

    I think one point where we all may be on different pages in this disucssion is the project type you want to work with / create.

    should this be a VSTO add-in (a template in the VS 2010 Ofifce folder) or a COM Add-in (the VS Shared Add-in template)? The XML code and the code it triggers will not differ, but the "plumbing" for it will. That may be what's mixing things up...


    Cindy Meister, VSTO/Word MVP

    Sunday, April 29, 2012 5:45 AM
    Moderator
  • Hi Cindy,

    thanks for helping again! I am aiming for a COM Add-in (meaning it is always active, no matter what kind of document the user uses in word).

    I am fairly sure to understand the xml and the callback functions, so I guess you must be right, my plumbing must be off.

    Thanks for your help!

    Michael

    Sunday, April 29, 2012 5:51 AM
  • Hi Michael

    The sample Rich pointed you at is for a VSTO add-in (meaning it will be there for all documents). As that is simpler to understand, to begin with, I suggest you start by creating a new solution then going to the Office folder and selecting Word 2010 Add-in.

    Press F5, which should start Word and load the add-in. We're just testing whether you get an error message; if not, we'll assume your system is happy with this. Exit Word.

    Right-click the solution in the Solution Explorer and choose to add a new component. From the list of components, choose Ribbon XML. This will add a Ribbon class to your add-in with some skeleton code as well as a Ribbon XML file with some "starter" XML.

    You should now be able to add the Commands section to the Ribbon XML (as in all the above examples). Then create a method in the Ribbon class with the same name as you specify for the onAction attribute in the xml. Just put a simple MessageBox.Show("hello world") type of thing in there - keep it simple.

    Press F5 then try to use the command you've repurposed.


    Cindy Meister, VSTO/Word MVP


    Sunday, April 29, 2012 6:26 AM
    Moderator
  • Hi Cindy,

    I followed your advice and created the most simple example, with the following xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
      <commands>
        <command idMso="Copy" onAction="myCopy" />
      </commands>
      <ribbon>
        <tabs>
          <tab idMso="TabAddIns">
            <group id="MyGroup"
                   label="My Group">
            </group>
          </tab>
        </tabs>
      </ribbon>
    </customUI>

    and the following callback method

            public void myCopy()
            {
                MessageBox.Show("Hi!");
            }


    F5 worked and the add in was loaded. However no message box appeared when using copy. I tried FileSave as command and the save button, same result.

    I then added the following code to my addin class (as stated in the comments of the the ribbon class, Ribbon1.cs):

            protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
            {
               return new Ribbon1();
            }

    I tried f5 again with the the result that the repurposed command did nothing anymore, no textbox, no normal behavior. (I did include using System.Windows.Forms;)

    This is still the closest I got on repurposing it, so thank you very much. Is the normal behaviour turned off as soon as one repurposes a command?

    I will try some other simple things (insert text for example) and see if they trigger.

    Cheers and many thanks again,

    Michael

    Sunday, April 29, 2012 6:53 AM
  • Hi Michael

    Yes, you're getting very close :-)

    What's missing is that the method signature of myCopy isn't correct. Compare yours with mine:

       public

    void myCopy(Office.IRibbonControl ctl, ref bool CancelDefault)I get an error message if I try yours. Since you aren't, you should activate an option in Word in your test environment: Word Options/Advanced/General/Show add-in user interface errors

    Cindy Meister, VSTO/Word MVP

    Sunday, April 29, 2012 7:22 AM
    Moderator
  • Hi Cindy,

    that worked, awesome! I basically had that code before, but something must always have been wrong with the rest.

    Now the interesting question for me is: how do I keep the original function of the command and just add something to it? I would be particulary interested in grabbing the copied content and adding something. I guess I could access the clipboard, but maybe its easier.

    Thanks for your kind help,

    Michael


    p.s.: I guess I should mark something as the answer of the thread, however I think every answer helped.
    • Edited by Rinmic Sunday, April 29, 2012 7:35 AM
    Sunday, April 29, 2012 7:34 AM
  • Hi Michael

    I'm not sure I understand what kind of thing you want to add? Could you offer an example?

    In order to let the "real" command execute, set the CancelDefault parameter to false, then it will perform the action after your code is completed.

    Here's an example that puts some text in front of the current selection, extends the range to be copied to include that text, then copies that and removes the added text.

            public void myCopy(Office.IRibbonControl ctl, ref bool CancelDefault)
            {
                CancelDefault = true;
                Word.Range rng = Globals.ThisAddIn.Application.Selection.Range;
                Word.Range rngCopy = rng.Duplicate;
                object oCollapseStart = Word.WdCollapseDirection.wdCollapseStart;
                rng.Collapse(ref oCollapseStart);
                rng.Text = "Text at the start. ";
                rngCopy.Start = rng.Start;
                rngCopy.Copy();
                rng.Delete(ref missing, ref missing);
            }


    Cindy Meister, VSTO/Word MVP

    • Marked as answer by Rinmic Sunday, April 29, 2012 8:29 AM
    Sunday, April 29, 2012 7:59 AM
    Moderator
  • Hi Cindy,

    this is exactly what I needed, thanks. I am adding some signature to copied content, so that the receiving application can read that signature and add it to other metadata of the receiving document. If this concept is used on all actions, I will be able to display links in between documents that inherited content from each other.

    I tried to add your method to my code. I had to make the following changes:

    Microsoft.Office.Interop.Word.Range rng = Globals.ThisAddIn.Application.Selection.Range;
    Microsoft.Office.Interop.Word.Range rngCopy = rng.Duplicate;

    But I still get an error (actually 5) on:

    rng.Delete(ref missing, ref missing);
    I guess I need to name whats to be deleted precisely?

    Cheers,

    Michael


    • Edited by Rinmic Sunday, April 29, 2012 8:28 AM
    Sunday, April 29, 2012 8:28 AM
  • Hi Michael

    I having a using statement at the top of my code "page" so that I don't have to type out the full reference:

    using Word = Microsoft.Office.Interop.Word;

    I tested the method before posting it and didn't get any errors. so I have no idea what the problem could be on your end if you don't provide more detailed information. When you ask about errors, you need to include the full error information and, in this case, also describe what it is you're trying to delete. In my case, it was only text.


    Cindy Meister, VSTO/Word MVP

    Sunday, April 29, 2012 8:39 AM
    Moderator
  • Sorry about that,

    Error    1    The name 'missing' does not exist in the current context    c:\users\michael\documents\visual studio 2010\Projects\WordAddIn1\WordAddIn1\Ribbon1.cs    69    28    WordAddIn1
    Error    2    The name 'missing' does not exist in the current context    c:\users\michael\documents\visual studio 2010\Projects\WordAddIn1\WordAddIn1\Ribbon1.cs    69    41    WordAddIn1
    Error    3    The best overloaded method match for 'Microsoft.Office.Interop.Word.Range.Delete(ref object, ref object)' has some invalid arguments    c:\users\michael\documents\visual studio 2010\Projects\WordAddIn1\WordAddIn1\Ribbon1.cs    69    13    WordAddIn1
    Error    4    Argument 1: cannot convert from 'ref missing' to 'ref object'    c:\users\michael\documents\visual studio 2010\Projects\WordAddIn1\WordAddIn1\Ribbon1.cs    69    28    WordAddIn1
    Error    5    Argument 2: cannot convert from 'ref missing' to 'ref object'    c:\users\michael\documents\visual studio 2010\Projects\WordAddIn1\WordAddIn1\Ribbon1.cs    69    41    WordAddIn1

    It still is only text I try to delete, I kept the exakt method you posted for test purposes.

    Thanks again.

    Michael

    edit: I researched it myself and it seems that somehow the System.Type.Missing does not get detected properly. I will fix this myself in no time :D. Many thanks again for all the help, it is greatly appreciated. The stated question was fully answered.

    edit 2: using rng.Delete(); worked just fine.

    • Edited by Rinmic Sunday, April 29, 2012 10:57 AM
    Sunday, April 29, 2012 8:52 AM
  • Hi Michael

    Glad you've got it under control :-)


    Cindy Meister, VSTO/Word MVP

    Monday, April 30, 2012 11:36 AM
    Moderator
  • Hi Cindy,

       Its still the same issue. Not sure what I am missing here.

    Thanks,

    Badrinath

    Thursday, May 10, 2012 6:55 PM
  • Hi Badribnath,

    do I understand correctly that your problem is that the default function of your command is still active, even though you assigned cancelDefault = true?

    If so, I can at least confirm the problem, although I have it the other way around. No matter what value I assign to cancelDefault, the default action for my repurposed commands remains deactivated. Although this is not an issue for me at the moment (since I want those default properties deactivated), I would still like to know why.

    Cheers,

    Michael

    Thursday, May 10, 2012 11:10 PM
  • Hi Badrinath

    Could you please post your problem as a NEW discussion, with all the information required to understand it? It's very difficult to deal with it mixed into the other discussion - which is now closed. We can help you much better in a separate, dedicated discussion :-)


    Cindy Meister, VSTO/Word MVP

    Friday, May 11, 2012 9:39 AM
    Moderator
  • Hi Cindy,

       I have created a new discussion, please find the discussion with heading "Re-purposing a default Save/SaveAs command using a WordAddin" and the link for the thread given below:

    http://social.msdn.microsoft.com/Forums/pl-PL/worddev/thread/0827f54b-1695-4535-bfdc-9a218fb10fa6

    Thanks,

    Badrinath

    Friday, May 11, 2012 6:54 PM