Be the first user to complete this post

  • 0
Add to List

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



Also Read:

  1. VBA-Excel: Working with Bookmarks- Insert text After Bookmark
  2. VBA-Excel: Working with Bookmarks- Insert text After Bookmark
  3. VBA-Excel: Format already written text in a word document – Format All Content
  4. VBA-Excel: Format already written text in a word document – Format All Content
  5. VBA-Excel: Add/Insert a Image/Picture in Word Document
  6. VBA-Excel: Format the Existing Table in a Word document
  7. VBA-Excel: Open an Existing Word Document
  8. VBA-Excel: Add Table and fill data to the Word document