2012-03-20 47 views
0

我是新來的VSDO,我想打開新的模板/單詞彈出窗口,當按鈕被按下時,我已經尋找適當的命令酒吧的論點,但沒有成功找到它。如果有人可以向我展示打開此彈出窗口的相關代碼,我們將不勝感激。在word 2007/2010的c#插件中打開新的模板窗口

回答

0

附着在MSDN論壇上回答: 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);