我一直在编写Microsoft Office Word的加载项。我需要在新窗口Word中打开现有文档。我怎么能这样做?
答案 0 :(得分: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");
}