Be the first user to complete this post

  • 0
Add to List

VBA-Excel: Open and Print the Word Document

To open an existing Microsoft Word Document  and print it using Microsoft Excel, you need to follow the steps below:

  • Create the object of Microsoft Word
  • Create Doc object using MS word object, Open the existing word document by providing the complete path
  • Make the MS Word visible
  • Print the word document
  • Close the word document

Create the object of Microsoft Word

Set objWord = CreateObject(“Word.Application”)

Create Doc object using MS word object, Open the existing word document by providing the complete path

Set objDoc = objWord.Documents.Open("D:\OpenMe.docx")

Make the MS Word Visible

objWord.Visible = True

Print the word document

objDoc.PrintOut

Close the word document

objWord.Quit

Complete Code:

Function FnPrint()

  Dim objWord

  Dim objDoc

  Set objWord = CreateObject("Word.Application")

  Set objDoc = objWord.Documents.Open("D:\OpenMe.docx")

  objWord.Visible = True

  objDoc.PrintOut

  objWord.Quit

End Function



Also Read:

  1. VBA-Excel: Create and Save the Word document
  2. VBA-Excel: Add/Insert a Image/Picture in Word Document
  3. VBA-Excel: Change Font, Color, Weight of Table Data in the Word document
  4. VBA-Excel: Create or Add Worksheets at the Run time.
  5. Excel-VBA : Send a Simple Mail From MS Outlook Using Excel
  6. VBA-Excel: Working with Microsoft Word
  7. Excel-VBA : Open a MS Word Document using Excel File using Explorer Window.
  8. VBA-Excel: Format already written text in a word document – Format Paragraphs