VBA-Excel: Writing Text to Word document

For writing text in Microsoft Word Document using Microsoft Excel, you need to follow the steps below:

  • Create the object of Microsoft Word
  • Add documents to the Word
  • Make the MS Word visible
  • Create a Selection object with the help of WordObject.
  • Use this Selection object to type the text into the WordDocument.

Read moreVBA-Excel: Writing Text to Word document

VBA-Excel: Open an Existing Word Document

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

  • Create the object of Microsoft Word
  • Using MS word object, Open the existing word document by providing the complete path
  • Make the MS Word visible

 

Create the object of Microsoft Word

Set objWord = CreateObject(“Word.Application”)

Read moreVBA-Excel: Open an Existing Word Document

VBA-Excel: Working with Microsoft Word

You can do wonders with Microsoft Word using your excel, like creating a new word file, open an existing word file, saving it to specific location in your hard drive, print the word document, Add tables to your word document and many more.

Since its and external application, to deal with it first step would be get the instance of the word file or you can say create the Object of the word file using CreateObject Function.

Set objWord = CreateObject("Word.Application")

And that’s it Now you are all set to perform various operations.

In next few sessions you will see the following operations on Word using Excel.

Read moreVBA-Excel: Working with Microsoft Word