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

Free Support Forum - aspose.com

Hexadecimal Values in merged document

Hi there,

I have an issue with merging values in to a Word document via Aspose.Words. One of our merge fields is supposed to contain a hexadecimal ‘code’ after the merge process.

Currently I return this code via the IMailMergeDataSource as a string. This normally works fine, however if the code to return looks like an exponential number e.g. 38E4 the ‘code’ field will contain 380000 rather than the expected hex value. One of my associates suggested simply returning the value as an integer and getting Word to convert it to hex via the *Hex merge field switch but this doesn’t appear to work either…

So I guess 2 questions:

1. Is there a way to stop the field being converted from a hexadecimal value to an integer in this situation?

and failing that…

2. Does Aspose.Words recognise the *Hex switch?

I am using Word 2003 with Aspose.Words 7.0.0.0


Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request.

1. I cannot reproduce the problem on my side. I use the following code for testing:

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

doc.MailMerge.Execute(new string[] {"test"}, new object[] {"0xFFFF"});

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

I use the latest version of Aspose.Words. You can download it from here:

http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/category1188.aspx

2. No, unfortunately, Aspose.Words does not support \* HEX switch at the moment. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.

Best regards.

Thanks for the quick reply. Sorry, I may not have been clear enough, I’m passing the back the value as a string in the form of something along the lines of “12E3” or “1E23” not in the hexadecimal format like “0xFFFF”. If you use your code and pass one of these values in place of the 0xFFFF value you used for testing you’ll see what I mean.

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. I still cannot reproduce the problem on my side. Please try using the latest version of Aspose.Words.

Best regards.

Hi Alexey

Thanks for that, the new version does correct the issue. Sorry to have wasted your time.

The issues you have found earlier (filed as 5260) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.