Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Contact us
Hide Buttons

VBA-Excel: Open word document using GetObject()

Open word doc­u­ment using GetO­b­ject(), you need to fol­low the steps below:

  • Get the ref­er­ence to exist­ing word file using GetObject
  • Get the object of Microsoft Word appli­ca­tion object
  • Make the MS Word visible

Get the ref­er­ence to exist­ing word file using GetObject

Set obj­Doc = GetO­b­ject (“D:\OpenMe.docx”)

Get the object of Microsoft Word appli­ca­tion object

Set obj­Word = objDoc.Application

Make the MS Word visible

objWord.Visible = True

 

Function FnOpenWordDoc()

  Set objDoc = GetObject ("D:\OpenMe.docx")

  Set objWord = objDoc.Application

  objWord.Visible = True

End Function

 


 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: