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 document using GetObject(), you need to follow the steps below:

  • Get the reference to existing word file using GetObject
  • Get the object of Microsoft Word application object
  • Make the MS Word visible

Get the reference to existing word file using GetObject

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

Get the object of Microsoft Word application object

Set objWord = 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: