Interfacing with Word 2003

VentureFree

Well-known member
Joined
Jan 9, 2008
Messages
54
Programming Experience
5-10
I've got a template Word document that I am programmatically modifying before printing. My desire is to have certain tags in the original document that act as place holders for information that I'd like to add at run time. I can do that once without a problem (I've just recorded a Macro to Find and Replace with the data and imported that code into my program). However, I need to print several copies, each with their own information to be added. I had hoped to simply record an Undo for each Find and Replace after I've printed, but there doesn't seem to be a way to do that while recording a macro. Is there a way to mimic that in code? Or is there some other way to revert the document back to it's original state after I've done all my Find and Replace's?

Is it possible to copy the page before any modification is made, store that internally and simply select all and type over with the original content? I wouldn't want to simply paste from the clipboard after each iteration, since someone could potentially copy something else into the clipboard at some point during execution. So how would I store the content internally in such a way that I could preserve the original formatting of the text (there are list items and bolded and italicized text in the document)?
 
Last edited:
Back
Top