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

Free Support Forum - aspose.com

Formatted fields

I have a document template(attached - Basic Letter.doc) from which I am creating a document. In the template, the DOS field has a switch to display the format as January 1, 2010 - {DOCPROPERTY "~DOS" \@ "MMMM d, YYYY" }.

Using Aspose, I pass the values into the custom document properties & then update the fields:

  • doc.CustomDocumentProperties["~PtFirst"].Value = firstname;
  • doc.CustomDocumentProperties["~PtMiddle"].Value = middlename;
  • doc.CustomDocumentProperties["~PtLast"].Value = lastname;
  • doc.CustomDocumentProperties["~DOS"].Value = dateofService;
  • doc.Range.UpdateFields();

However, in the final saved document(saved.doc), the formatting is not put in. The date instead displays as 01/01/2010.

What can be done about this?


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

Thanks for your request. I cannot reproduce the problem on my side using the latest version of Aspose.Words (8.1.0). You can download this version from here:


I use the following code for testing:

Document doc = new Document("in.doc");

doc.CustomDocumentProperties["~DOS"].Value = DateTime.Now;



Best regards,