Be the first user to complete this post

  • 0
Add to List

VBA-Excel: Get the Instance of already opened word document

For getting the instance of already opened Microsoft Word Document using Microsoft Excel, you need to follow the steps below:

  • Create the object of Microsoft Word application object
  • Make the MS Word visible
  • Check the name of currently open word doc

Create the object of Microsoft Word application object

Set objWord = GetObject(,"Word.Application")

Make the MS Word visible

objWord.Visible = True

Check the name of currently open word doc

Msgbox objWord.ActiveDocument.Name

Complete Code:

Function FnGetOpenedDocInstance

   Set objWord = GetObject(,"Word.Application")

   objWord.Visible = True

   Msgbox objWord.ActiveDocument.Name

End Function



Also Read:

  1. VBA-Excel - Merger - Merge or Combine Many Word Documents Into One
  2. VBA-Excel: Update XML File
  3. VBA-Excel: Working with Microsoft Word
  4. VBA-Excel: Change Font, Color, Weight of Table Data in the Word document
  5. Excel-VBA : Send a Simple Mail From MS Outlook Using Excel
  6. VBA-Excel: Appending Text to an Existing Word Document - at the End
  7. Excel-VBA : Open a MS Word Document using Excel File using Explorer Window.
  8. VBA-Excel: Add/Insert multiple Images/Pictures from a folder in Word Document