View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default Using an Excel macro to open a Word File

In my opinion, neither: use automation with the Word object library. Add the
reference to Word to your project and then:

Dim WordApp as Word.Application
Dim WordDoc as Word.Document

Set WordApp = New Word.Application
Set WordDoc = WordApp.Documents.Open("C:\Blah\Blah\MyDoc.doc")
....
WordDoc.Close
WordApp.Quit

--
- K Dales


"lhyer" wrote:

Can someone please help me with an example of what the code would look like
to open a Word file from a macro in Excel? Is it better to use the shell or
the createobject function?