I have created a letter generation system that works as follows:
1) Data records in a table are created on the server.
2) User invokes a client VB.net application that selects the data records created in step (1) and loads these records into a Datagrid.
3) User can select the records he/she wishes to mailmerge by selecting a checkbox field I have added to the Datagrid/Dataset.
4) I create a Dataview object based on the Datagrid Dataset and select only checkbox fields = true.
5) Mailmerge Dataview created in step (4) to my document.
6) Update the server data records as already having been printed so they are not loaded into the Datagrid again.
Everything basically work up to this point......
What I wanted to do is update each record on the server as having already been printed as I mailmerge each data record. Microsoft has a few MailMerge methods defined before and after the mailmerge of each record. I am using the HandleMergeField method to, basically, catch each record - that works fine.
The problem is that the HandleMergeField is only passed fields that are defined on the document. The key fields I need to achieve an SQL UPDATE are not required and don't make sense on the document. But, they are in the Dataview which is the source of the mailmerge. I want access to these entries while I am mailmerging each record.
Is there any mechanism I can use to do this?