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

Free Support Forum - aspose.com

Date Field along with localization

Hi,


How to insert Date field in header of word document in java
and i want localization of that date field also.i mean to say ,in word it supports different formats of date based on the region .So can I achieve the same through Java …

Thanks
Deepak

Hi

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

Thanks for your inquiry. You can specify locale, in this case field will display date in the specified culture format. For example please see the following simple code:

// Specify locale (for instance Farance).

// All locale ids are available here http://msdn.microsoft.com/ru-ru/goglobal/bb964664(en-us).aspx

builder.getFont().setLocaleId(1036);

// Insert Date field.

builder.insertField("DATE \\@ \"dd MMMM yyyy\"", "");

Hope this helps.

Best regards,