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

Free Support Forum - aspose.com

MoveToMergeField Format

Hi, we’re currently using words v8.2 for vb.net 1.1 but we are having problems with mergefields that contain format switches e.g. # $0.00 or FirstCap etc.
I searched the forum and noticed people have been able to get this to work, but then I noticed in those example they were using the execute mailmerge function whereas we use the MoveToMergeField function.
So my question is, does formatting work when using it in this way or is it only work the execute method?
Currently we use code similar to;

if docbuild.MoveToMergefield(mergename) then
end if

This works fine apart from ignoring any formatting or swtiches applied.
A consequence of this is some of the IF THEN Else expressions are failing because it is not converting the values.
Your help would be much appreciated.


Thanks for your request. There is no way to make formatting switches to work, if you use MoveToMergeField and Write methods. You should use MailMerge.Execute or MailMerge.ExecuteWithRegions methods.
DocumentBuilder.MoveToMergeField method just places DocumentBuilder cursor at the specified mergefied. Documentbuilder does not aware about formatting switches, which are specified in the mergefield.
Best regards.