Opening a word document from excel using VBA
Opening a word document from excel using VBA
(OP)
Hi,
I'm pretty new to VBA, and I am trying to open a word document from excel VBA. Can anyone help?
I'm pretty new to VBA, and I am trying to open a word document from excel VBA. Can anyone help?





RE: Opening a word document from excel using VBA
CODE
If Tasks.Exists("Microsoft Word") Then Set WordApp = GetObject(, "word.application")
If WordApp = "" Then Set WordApp = CreateObject("word.application")
WordApp.Documents.Open FileName:=DwellPath, ReadOnly:= _
False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:= _
"", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="", _
Format:=wdOpenFormatAuto
TTFN
RE: Opening a word document from excel using VBA
If all you want to do is open the Word document as a stand-alone application, then I would use the ShellExecute API using the name of the Word document.
On the other hand, if you want to open the document, and then manipulate the document from within the Excel application, then you will need to use the Word automation objects, as IRStuff has shown the beginnings of.