Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.
Tue Nov 10, 2015 12:54 am
Hi,
Just evaluating Spire.Doc, and i'm wondering if it's possible to insert a mail merge field from code?
I need to be able to add new merge fields to an existing word template.
Thanks

-

greens
-
- Posts: 2
- Joined: Mon Nov 09, 2015 12:30 am
Tue Nov 10, 2015 7:27 am
Hi,
Thanks for your interests in our Spire.Doc.
Our Spire.Doc supports it. Share sample code:
- Code: Select all
MergeField mergeField = new MergeField(document);
mergeField.Type = FieldType.FieldMergeField;
mergeField.FieldName = "Name";
paragraph.Items.Add(mergeField);
Best Regards,
Amy
E-iceblue support team
-


amy.zhao
-
- Posts: 3046
- Joined: Wed Jun 27, 2012 8:50 am
Fri Nov 13, 2015 8:09 am
Hi,
Has your issue been resolved?
Thanks for your feedback.
Best Regards,
Amy
E-iceblue support team
-


amy.zhao
-
- Posts: 3046
- Joined: Wed Jun 27, 2012 8:50 am
Sun Nov 15, 2015 10:16 pm
Hi Amy,
Thanks for your prompt response. Yes, that worked perfectly.
I'm putting together a proof of concept to confirm that Spire.doc can do everything we need. So I may have some further questions for you

-

greens
-
- Posts: 2
- Joined: Mon Nov 09, 2015 12:30 am
Mon Nov 16, 2015 1:26 am
Hi,
Thanks for your feedback.
Please feel free to write to us again for further questions. We are here to help you.
Best Regards,
Amy
E-iceblue support team
-


amy.zhao
-
- Posts: 3046
- Joined: Wed Jun 27, 2012 8:50 am