Be the first user to complete this post

  • 0
Add to List

VBA-Excel: Enumerate all the opened word document

To enumerate all the 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
  • Print all the word doc’s name and path

Create the object of Microsoft Word application object

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

Make the MS Word visible

objWord.Visible = True

Print all the word doc’s name and path

For each objDoc In objWord.Documents

Msgbox objDoc.Name

Next

Complete Code:

Function FnEnumerateAllWordDoc()

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

   objWord.Visible = True

   For Each objDoc In objWord.Documents

      Msgbox “Name: “ & objDoc.Name & “ And “ & objDoc.Path

   Next

End Function



Also Read:

  1. VBA-Excel: Consolidator – Merge or Combine Multiple Excel Files Into One
  2. VBA-Excel: Working with Microsoft Word
  3. Excel-VBA : Change Passwords for all the WorkSheets in one shot
  4. VBA-Excel: Perform Google Search on Internet Explorer using Microsoft Excel
  5. VBA-Excel: Working with Bookmarks- Insert text before Bookmark
  6. VBA-Excel: Get ALL The Opened Internet Explorer (IE) using Microsoft Excel
  7. VBA-Excel: Edit And Save an Existing Word Document
  8. VBA-Excel: Login To Already Opened GMAIL In An Internet Explorer (IE)