PDA

View Full Version : VBA to open word document from excel



jdooley3
11-11-2013, 08:02 AM
I am looking for code that opens a word document from excel. The word document does not need to be shown. When the document is open I will then search the document for certain words and extract them back to the excel worksheet. Any help would be greatly appreciated.

xld
11-11-2013, 08:17 AM
A simple Google search would have thrown up thousands of relevant links, but this should get you started


Public Function OpenWordDoc()
Dim wrdApp As Object
Dim wrdDoc As Object

Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
Set wrdDoc = wrdApp.Documents.Open("C:\myfile.doc")
End Function