首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

Microsoft.office.interop.word 有关问题

2012-04-21 
Microsoft.office.interop.word 问题想打开一个站点跟目录下的.doc文档,输入给Documents.open()的路径字符

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/

热点排行