读书人

Microsoft.office.interop.word 有关问

发布时间: 2012-04-21 14:34:44 作者: rapoo

Microsoft.office.interop.word 问题
想打开一个站点跟目录下的.doc文档,输入给Documents.open()的路径字符串应该怎么写?写完整路径可以打开。

C# code
G_wa = new Microsoft.Office.Interop.Word.Application();            G_wa.Visible = false;            object G_FilePath = txtOpenPath.Text;            Document P_wd = G_wa.Documents.Open(                ref G_FilePath, ref G_missing, ref G_missing, ref G_missing, ref G_missing,                ref G_missing, ref G_missing, ref G_missing, ref G_missing, ref G_missing,                ref G_missing, ref G_missing, ref G_missing, ref G_missing, ref G_missing,                ref G_missing);

这是其中一段代码,其中G_FilePath 我"~/abc.doc"或"./abc.doc"都试了。

[解决办法]
绝对路径啊!
是不是忘记加@了
[解决办法]
很多人使用

http://ufo-crackerx.blog.163.com/blog/static/11307877820111017113958413/

读书人网 >C#

热点推荐