I'm using WPTools to allow my users to define templates that they later use for printing in a mail merge process. When designing the templates, I need to allow the user to drop an object onto the document to represent the current date (not the date that the DATE object is created but one that can auto-update to reflect the current date when the user prints the template).
Using code similar to the following:
WPRichText1.ActivePar.InsertNewObject(0, wpobjTextObject, False, False, WPRichText1.WritingAttr.CharAttr).Name := WPTextFieldNames[wpoDate];
I can create an object that immediately displays today's date (08/05/09).
Question #1
Since the date was created as a TextObject rather than as literal text, I assume that when I save my template and recall it next month (say on September 1st), the date object will report the value 09/01/09. Am I correct in this assumption?
Question #2
When I print the template, in addition to the document being sent to the printer, I have to archive it to a database table so the user can review it at a later date. For historical accuracy, I have to display the archived document EXACTLY as it was printed, thus I need the DATE object to retain the date it reported when it was initially printed. So essentially at this point I need the DATE object NOT to automatically update itself.
What would be the best way for me to accomplish this? Is there some object type that reacts to an event, like a merge variable, that I could simply write an event handler for to control the date's display?