打开Word Doc

问题描述:

有人可以帮助我 - 我试图在我的程序中打开一个word文档,只需单击一个命令按钮(不使用对话框)就可以请一些人给我代码,因为我相信它相当简单。

could someone please help me - I am trying to open a word document within my program from just the click of a command button (not using dialog boxes) could some one please give me the code for this as am sure its fairly simple.

您是否尝试过使用Shell命令?
Have you tried using the Shell command?


这可能有效;除了我之外,它似乎对所有人都有效


将对象视为对象


oWord = CreateObject(" Word.Application" ;)

oWord.Visible = True

oWord.Documents.Open(" \ filename.doc")
this may work; it seems to work for everyone except for me


Dim oWord As Object

oWord = CreateObject("Word.Application")
oWord.Visible = True
oWord.Documents.Open("\filename.doc")


no我还没有尝试过shell命令 - 不确定它是如何工作的 - 但是就像上面那段代码一样(还没有尝试过,但是还没有回到结果)是不是只有简单的代码可以完成这项工作?

到目前为止感谢
no I havent tried shell command - not sure how it works - but like that code above (havent tried yet ill get back on the outcome) is there not just simple code that will do the job?
thanks so far