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 - Merger - Merge or Combine Many Word Documents Into One
  2. Excel-VBA : Prevent Changing the WorkSheet Name
  3. Excel-VBA : Send a Simple Mail From MS Outlook Using Excel
  4. VBA-Excel: Create and Save the Word document
  5. VBA-Excel: Edit And Save an Existing Word Document