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

Free Support Forum - aspose.com

Can I access merge field formatting rules from code?


I want get access to the extra mergefield information that users might add to document templates. For example, they might specify the “data to be inserted before the merge field”…

Is it possible when I process the document and apply the mail merge that I can get access to this extra information at all?


Thanks for your request. Merge field formatting is applied using formatting switches. Unfortunately, there is no direct way to access them upon executing mail merge. The only way to access them is getting and parsing field code. Field code is the text between FieldStart and FieldEnd nodes of the appropriate field. You can see field codes in MS Word by pressing Alt+F9.
Best regards,


The field code that I have looks like this:

{MERGEFIELD CourseDate.EndDate \@ "dd-MMM-yyyy h:mm am/pm"}

Can I get at this raw data and parse this?

Thanks for your request. Yes, you can, but there is no direct way. You can use the same approach as used here:
Best regards,