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
Declare END_OF_STORY and MOVE_SELECTION as variables
Dim END_OF_STORY
Dim MOVE_SELECTION
Assign MOVE_SELECTION =0 and END_OF_STORY = 6
END_OF_STORY = 6
MOVE_SELECTION = 0
Create the object of Microsoft Word
Set objWord = CreateObject(“Word.Application”)
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
Create a Selection object with the help of WordObject.
Set objSelection = objWord.Selection
Move the Selection to the end of the document.
objSelection.EndKey END_OF_STORY, MOVE_SELECTION
Append the text in the Word Document using SelectionObject
objSelection.TypeText (“Whattt..I am at the End of the Document. Not Fair :(” & vbCrLf)
Complete Code:
Function FnAppendAtEND() Dim objWord Dim objDoc Dim objSelection Dim END_OF_STORY Dim MOVE_SELECTION END_OF_STORY = 6 MOVE_SELECTION = 0 Set objWord = CreateObject("Word.Application") Set objDoc = objWord.Documents.Open("D:\OpenMe.docx") objWord.Visible = True Set objSelection = objWord.Selection objSelection.Font.Bold = True objSelection.EndKey END_OF_STORY, MOVE_SELECTION objSelection.Font.Size = "25" objSelection.Font.Color = RGB(12, 200, 0) objSelection.TypeText ("Whattt..I am at the End of the Document. Not Fair :(" & vbCrLf) End Function

Good work smit.
techie
thx siva 🙂
Is there some VBA code that can combine certain Word documents and saved as a new file based on checkboxes selected on Excel. For example, if there were 3 checkboxes on Excel and each checkbox had a corresponding Word file with content then based on what checkboxes are selected by the user their corresponding Word files would be merged to one new file. Any suggestions would be greatly appreciated.
Sorry For the late reply,
Refer This
http://excel-macro.tutorialhorizon.com/vba-excel-merger-merge-or-combine-many-word-documents-into-one/
Sumit