Application 打开word问题,在线等!急急急!!!
我在用Application 对象打开word时在运行到OPEN时出现如下错误请各位大侠给帮忙看看“"Word 在试图打开文件时遇到错误。\n请尝试下列方法:\n* 检查文档或驱动器的文件权限。\n* 确保有足够的内存和磁盘空间。\n* 用文本恢复转换器打开文件。\r (D:\\Project\\...\\leikun20090726092825.doc)"”
代码如下:()
private Void getContext(string file)
{
Application newApp = new Application();
Object nullobj = System.Type.Missing;
Object fileobj = file;
Object ConfirmConversions = false;
Object ReadOnly = false;
Object AddToRecentFiles = false;
Microsoft.Office.Interop.Word._Document doc = newApp.Documents.Open(ref fileobj, ref ConfirmConversions, ref ReadOnly,
ref AddToRecentFiles, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj,
ref nullobj);
}
}