Consulting

Results 1 to 2 of 2

Thread: VBA to open word document from excel

  1. #1

    VBA to open word document from excel

    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.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    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
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •