Received : 2007/09/17 06:46:10
Message : While trying to do merge region with a date field ({MERGEFIELD EventStartTime \@" MM/dd/yy h:mm AM/PM"}, AM/PM are being replaced with A9/P9 where 9 was the month.
if we use AM/PM as am/pm i.e. ({MERGEFIELD EventStartTime \@" MM/dd/yy h:mm am/pm"} then the merge happens correctly.
Hi
Thanks for your request. I have reproduced this problem and logged it into our defect database as issue # 3747. We will try to fix it in one of future releases. The notification will be posted here in this thread as soon as it will be done.
You can use workaround now. See the following code.
Actually i am a lil weary of using this option as it has two side effects:
My documents can be huge and in that case the replacement may have performance hit.
If in my document , I have AM/PM present other than in merge fields then this will also get replaced with am/pm.
Please suggest if there is a way to find the format of the merge field in ASPOSE.WORDS.
Also this requirement (AM/PM) is something of that we need to be addressed urgently so can u provide me with a hot fix or something for the same.
Hi
Thanks for your request. We will investigate whether and when it can be fixed. Please expect a reply before the next hotfix (within 2-3 weeks). We might just fix it by then or provide more information
Also you can try to use the following code as workaround.
// get all filds from document
NodeList fieldStarts = doc.SelectNodes("//FieldStart");
foreach (FieldStart mFieldStart in fieldStarts)
{
// get run that represents format.
Run fieldCode = (Run)mFieldStart.NextSibling.NextSibling.NextSibling;
// replace AM/PM with am/pm
fieldCode.Text = fieldCode.Text.Replace("AM/PM", "am/pm");
}