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

Free Support Forum - aspose.com

Problems upgrading from v10.5 to v14.2

Hello,


I have a problem with my previous version (v10.5), where the PAGE number is correct when I generate a DOC file, but incorrect when I generate a PDF file (same code, only the Save() part changes).
So I wanted to test with the current version, but it seems like you made some breaking changes…

Previously, in version 10.5, I could use a MERGEFIELD similar to:
{ MERGEFIELD Value # “C” * MERGEFORMAT }

And it would display my currency value in the “C” format (http://msdn.microsoft.com/en-us/library/dwhawy9k(v=vs.110).aspx#CFormatString). I attached my doc file and the result generated with Aspose.Words v10.5
Now, when I execute this with v14.2, I have an error “The specified format ‘C’ is invalid”.

Here is the code I am using:
Document doc = new Document(@“E:\Projets\Tests\Aspose.Tests\Data\test.doc”);
doc.MailMerge.Execute(new[] { “Value” }, new object[] { 12345.67 });
doc.UpdatePageLayout();
doc.UpdateFields();
doc.Save(@“E:\Projets\Tests\Aspose.Tests\Data\result.doc”, SaveFormat.Doc);


This is a big show stopper for me, especially that I already have dozens of documents that are using this format, etc…
Where can I see all the breaking changes since v10.5?

Thank you,

Regards,

Hi there,


Thanks for your inquiry.

Please note that Aspose.Words mimics the same behavior as MS Word does. If you perform the mail merge operation with same field ({ MERGEFIELD Value # “C” * MERGEFORMAT }) using MS Word, you will not get the required output. Please check the attached image for detail.

Please check the mail merge field Switches from here:
http://office.microsoft.com/en-us/word-help/field-codes-mergefield-field-HP005186172.aspx
http://office.microsoft.com/en-001/word-help/format-merged-data-HP005187180.aspx

Every new release of Aspose.Words comes up with some new features, enhancements in the existing features and bug fixes. Please upgrade to the latest version of Aspose.Words for .NET 14.3.0.

In your case, I suggest you please format the currency fields as follow:

To display the number “34987.89” as “$34,987.89,” add a numeric picture switch (# $#,###.00).

Please let us know if you have any more queries.