How Do I Create a Dynamic Word Document? (Magic xpa 3.x)
-
Create a document in Word that looks about like what you want.
-
Where you want your tags, add some special string, such as qqqMG_Custq. Do not use the <!$MG_Cust> format, because the special characters will be converted by Word in the next step.
-
Save the document as HTML, then close it in Word.
-
Edit the HTML with a text editor. Replace your special tags, such as qqqMG_Custq, with the Magic xpa tags, such as <!$MG_Cust>. Add your MGREPEATs and MGIFs as needed.
Hint: If you use a unique string, like qqq, you can let the Find/Replace command do most of the work.
-
Use this HTM file as your Merge template.
-
For your output file name, use the DOC extension.
Now, when the document is created, it will open in Word and look like a Word document.
Note: This method also works for the RTF format.
The Online and Rich Client Samples projects (program MG04 and RMG04)