We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Checklist with Mail Merge

Is there a way to make a checklist like this using Mail Merge?
http://office.microsoft.com/en-us/word-help/make-a-checklist-in-word-HA001162451.aspx

I have a list of options in a data structure, some of which need to be checked off in the document. Right now I’m just printing the options with a check mark character in front of them (see below), but I’d really prefer to use an actual checklist.

✓ Option 1
Option 2
Some of the options need to have indented text below them, too. This is already kind of a problem because the text wraps like this (with only the first line indented).
Option 3
✓ Option 4
The text should wrap
like this.
Option 5

It doesn’t need to be editable. Any help or suggestions would be greatly appreciated.

Thanks,
Mike

Hi

Thanks for your request. I think, in your case you can use Mail Merge with Regions and the following technique to insert checkboxes into your document:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/howto-insert-check-boxes-during-mail-merge.html

Please see the following link to learn more about Mail Merge with Regions.

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/mail-merge-with-regions-explained.html

Please let us know if you need more assistance, we are always glad to help you.

Best regards,

Thank you for your response. Unfortunately, I’m using Aspose.Words for .NET 8.1, and it doesn’t appear to have the IFieldMergingCallback interface in the Reporting namespace. Is this functionality not available in older versions of Aspose.Words?

Thanks,
Mike

Hi Mike,

Thanks for your request. In older versions of Aspose.Words you can use MergeFieldEventHandler instead of IFieldMergingCallback:

public void Test001()

{

//Open document

Document doc = new Document(@"Test001\in.doc");

//Create dummy datasource

string[] names = { "myField" };

string[] values = { @"blabalbla" };

//Create MergeFild event handler

doc.MailMerge.MergeField += new MergeFieldEventHandler(MailMergeEvent);

//Execute mail merge

doc.MailMerge.Execute(names, values);

//Save outpur document

doc.Save(@"Test001\out.doc");

}

void MailMergeEvent(object sender, MergeFieldEventArgs e)

{

// do what you need here

// ....................................................

}

Hope this helps.

Best regards,

This works perfectly. Thank you very much for your help!