//******上面的代码是生成word文档过程,一切很正常*********
object path = HttpContext.Current.Server.MapPath("../word/" + getFileName() + ".doc");
word.ActiveDocument.SaveAs(ref path, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing);
doc.Close(ref Nothing, ref Nothing, ref Nothing);
word.Quit(ref Nothing, ref Nothing, ref Nothing);
word = null;
System.GC.Collect();
return path.ToString();////////////////////////////////////////////
doc是Word.Document对象
word是Word.Application对象
在调用word.ActiveDocument.SaveAs时出错
错误信息:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt. 我在本机测试一切都很正常,放在服务器上就出错了,
希望高手帮忙!
object path = HttpContext.Current.Server.MapPath("../word/" + getFileName() + ".doc");
word.ActiveDocument.SaveAs(ref path, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing);
doc.Close(ref Nothing, ref Nothing, ref Nothing);
word.Quit(ref Nothing, ref Nothing, ref Nothing);
word = null;
System.GC.Collect();
return path.ToString();////////////////////////////////////////////
doc是Word.Document对象
word是Word.Application对象
在调用word.ActiveDocument.SaveAs时出错
错误信息:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt. 我在本机测试一切都很正常,放在服务器上就出错了,
希望高手帮忙!
aspx 里调用该exe,这样应该不会出问题
这句去掉看