Search code examples
c#add-inribbon

open the new template window within c# addin in word 2007/2010


I'm new to VSDO, and i want to open new template/word popup window within word when the button is pressed, I've looked for the appropriate command bar argument but didn't succeeded in finding it. if someone can show me the relevant code for opening this popup, it will be appreciated.


Solution

  • attached the answer in msdn forum: opening the new document dialoge within c# addin in word 2007/2010

    Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application();
    Microsoft.Office.Interop.Word.Document oWordDoc = new Microsoft.Office.Interop.Word.Document();
    Object oMissing = System.Reflection.Missing.Value;
    
    oWord.Visible = true;
    
    oWord.Activate(); 
    
    oWord.Dialogs[WdWordDialog.wdDialogFileNew].Show(oMissing);