0

我一直在为 Microsoft Office Word 编写插件。我需要在新窗口 Word中打开现有文档。我怎样才能做到这一点?

4

1 回答 1

0

试试这个代码,如果它达到了你的要求,请询问。

 public void OpenExistDoc(string docName)
    {
        object fileName = docName;
        object oMissing = Type.Missing;
        this.Application.Documents.Open(ref fileName, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing
            , oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing);
    }


 private void ThisAddIn_Startup(object sender, System.EventArgs e)
    {
        this.OpenExistDoc("your file");
    }
于 2013-10-15T06:57:30.950 回答