Bookmarks example

Don’t seem to find an example of using Bookmarks rather than Merge Fields. Your documentation says that they are supported. It is necessary for us to resolve this issue ASAP.
-----------------

To insert data at bookmarks you need to use DocumentBuilder.MoveToBookmark and then other DocumentBuilder methods to insert content.
MailMerge.Execute can only be used with merge fields.

Thanks for your response. We still would like to have some code samples using bookmarks. We have not being successful with the MoveToBookmark – builder.write thing.
In addition, we are having a difficulty opening multiple word documents (even using merge fields) with multiple records from the same data source (depending on a few conditions). I realize that filtering could be an option, however, we would not know what to filter until we read the whole data source anyways. Any ideas? We will love a sample of your product resolving a similar situation.

The fact of the matter is, we have purchased 2 enterprise licenses for 2 government clients in 2 separate states, which have a heavy investment in documents with bookmarks and refuse to change them to Merge Fields and that currently produce multiple word documents from the same data source in the fly from selection screens.

Here is an example how to use bookmarks:

Word word = new Word();
Document doc = word.Open("myfile.doc");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToBookmark("Target1");
builder.Write("Anything");
doc.Save("myfile out.doc");

I’m not exactly sure of of your requirements and the problems you think you are facing.

Just open the document, create a document builder for the document, move to the bookmark, insert your data, save the document.

Since you are using bookmarks, not mail merge, all data selection, filtering, iteration over rows you need to write youself. It’s not a big deal usually and in fact, often leads to better performance during data population as mail merge tends to be a little slower. I recommended using bookmarks instead of merge fields to once client where it was very performance sensitive.

Never mind. Some better-no-say-what-I-think-about person created the document using Word 97, and when updated utilized word 2003. I will take the issue with Microsoft in Redwood about “portability” and “downward” compatibility.
Our documents work now.
I have coded a component to print automatically, but look forward to your release for the component.
Thanks for the support,
Ed