I’m trying to perform the following steps:
- Read Word docx
- Read Excel xlsx
- Loop through Excel
- For each row in Excel, replace text in Word document
- Write Word doc to new page in one Word document
Basically what I’m doing is mimicking a mail merge and want to end up with one multi-page Word document for easy printing. Yes there’s a reason why we aren’t just doing an actual merge in Word, which I unfortunately cannot share - just know there’s a valid reason.
The problem I’m having is I can read the Word document (Read Text), do the replace, and append to the output Word document. But it loses all formatting, images, etc.
Is there really no way to do this, without sending mouse clicks and hotkeys with Word open?