VBA-Excel: Format the Existing Table in a Word document

To Format the Existing Table in a Microsoft Word Document using Microsoft Excel, you need to follow the steps below:

  • Create the object of Microsoft Word
  • Open the already existing word document
  • Make the MS Word visible
  • Get the Table object
  • Edit  the data in table
  • Save the document

 

Create the object of Microsoft Word

Set objWord = CreateObject(“Word.Application”)

Read moreVBA-Excel: Format the Existing Table in a Word document

VBA-Excel: Add Table and fill data to the Word document

VBA-Excel: Add Table and fill data to the Word document

To Add Table and fill data to the Word document using Microsoft Excel, you need to follow the steps below:

  • Create the object of Microsoft Word
  • Create a document object and add documents to it
  • Make the MS Word visible
  • Create a Range object.
  • Create Table using Range object and define no of rows and columns.
  • Get the Table object
  • Enable the borders of table using table object.
  • Fill the data in table
  • Save the document

Read moreVBA-Excel: Add Table and fill data to the Word document

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

Read moreVBA-Excel: Enumerate all the opened word document

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

Read moreVBA-Excel: Get the Instance of already opened word document

VBA-Excel: Working with Bookmarks- Insert text After Bookmark

For inserting the text after the Bookmark in an existing Microsoft Word Document using Microsoft Excel, you need to follow the steps below:

Add a Bookmark “IMBOOKMARK” with name “bookmark_1

  • 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
  • Get the range object for the bookmark
  • Insert the text after the bookmark
  • Save the word document
  • Close the word document

Read moreVBA-Excel: Working with Bookmarks- Insert text After Bookmark

VBA-Excel: Working with Bookmarks- Insert text before Bookmark

For inserting the text before the Bookmark in an existing Microsoft Word Document using Microsoft Excel, you need to follow the steps below:

Add a Bookmark “IMBOOKMARK” with name “bookmark_1”

  • 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
  • Get the range object for the bookmark
  • Insert the text before the bookmark
  • Save the word document
  • Close the word document

Read moreVBA-Excel: Working with Bookmarks- Insert text before Bookmark

VBA-Excel: Find a word in a specific paragraph and change its formatting

To Find a word in a specific paragraph and change its formatting in an existing Microsoft Word Document 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 … Read more VBA-Excel: Find a word in a specific paragraph and change its formatting

VBA-Excel: Format already written text in a word document – Format Paragraphs

To Format already written text in a word document – Format Paragraphs  – Microsoft Word Document 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
  • Get the paragraphs count
  • Get the paragraph object using Paragraphs.Range
  • Do the formatting
  • Save the word document
  • Close the word document

Read moreVBA-Excel: Format already written text in a word document – Format Paragraphs

VBA-Excel: Format already written text in a word document – Format All Content

VBA-Excel: Format already written text in a word document – Format All Content

 

To Format already written text in a word document – Format All Content Microsoft Word Document 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
  • Create a Selection object with the help of WordObject.
  • Select the Whole content in the word document
  • Do the formatting
  • Save the word document
  • Close the word document

Read moreVBA-Excel: Format already written text in a word document – Format All Content

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”)

Read moreVBA-Excel: Open and Print the Word Document

VBA-Excel: Add/Insert multiple Images/Pictures from a folder in Word Document

To Add or Insert Multiple Images or Pictures in Microsoft Word Document using Microsoft Excel, you need to follow the steps below:

  • Declare END_OF_STORY and MOVE_SELECTION as variables
  • Assign MOVE_SELECTION =0 and END_OF_STORY = 6
  • Create the object of Microsoft Word
  • Create the object of FileSystemObject
  • Create Folder object using FileSystemObject and GetFolder method
  • Using MS word object, Open the existing word document by providing the complete path
  • Make the MS Word visible
  • Create a Selection object with the help of WordObject.
  • Access Folder files using Folder object
  • Get the image paths from the folder
  • Insert image in the word documents using AddPicture()
  • Insert a page break after every image

Read moreVBA-Excel: Add/Insert multiple Images/Pictures from a folder in Word Document

VBA-Excel: Add/Insert a Image/Picture in Word Document

To Add or Insert Images or Pictures in 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 a Selection object with the help of WordObject.
  • Set  Shapes object using InlineShapes
  • Insert image in the word documents using AddPicture()

 

Create the object of Microsoft Word

Set objWord = CreateObject(“Word.Application”)

Read moreVBA-Excel: Add/Insert a Image/Picture in Word Document

VBA-Excel: Appending Text to an Existing Word Document – at the End

To append the text at the end of the Microsoft Word Document using Microsoft Excel, you need to follow the steps below:

  • Declare END_OF_STORY and MOVE_SELECTION as variables
  • Assign MOVE_SELECTION =0 and END_OF_STORY = 6
  • 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 a Selection object with the help of WordObject.
  • Move the Selection to the end of the document.
  • Append the text in  the Word Document using SelectionObject

Read moreVBA-Excel: Appending Text to an Existing Word Document – at the End

VBA-Excel: Edit And Save an Existing Word Document

VBA-Excel: Save an Existing Word Document

To Edit and save 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 a Selection object with the help of WordObject.
  • Edit the Word Document using SelectionObject
  • Save the Word Document

Read moreVBA-Excel: Edit And Save an Existing Word Document

VBA-Excel: Create and Save the Word document

For creating and saving the Microsoft Word Document using Microsoft Excel, you need to follow the steps below:

  • Create the object of Microsoft Word
  • Create a document object and add documents to it
  • 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.
  • Save the document

 

Read moreVBA-Excel: Create and Save the Word document

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