最近遇到一个比较广泛的问题,请教各位:
我使用的VS2005,Frame 2.0版本,如何才能操作带有密码的Office文档?
现在的代码如下(Word):
第一次打开,并添加密码PasswordDocument,
Word.Document wordDoc = m_WordApp.Documents.Add(ref Template, ref NewTemplate, ref DocumentType, ref Visible);
wordDoc.SaveAs(ref filename, ref tempObject, ref tempObject, ref PasswordDocument, ref tempObject, ref tempObject, ref tempObject, ref tempObject, ref tempObject, ref tempObject, ref tempObject, ref tempObject, ref tempObject, ref tempObject, ref tempObject, ref tempObject);
第二次调用激活类ActivePaper(使用进程控制),弹出需要输入密码的对话框,我试过其他方法如自带的Open等都不能打开。
ActivePaper(path, PaperType.Word);