Formatting of Global Variables in Word

Navigation:  Formatting >

Formatting of Global Variables in Word

Previous pageReturn to chapter overviewNext page

Cultural Issues

To format a merge field, right click it and select Toggle Field Code. You can use most of formats supported by Word.

Some switches are not directly supported by Word, but are by QDV7. They are used to display and format values in a different culture than the document one. By default, formats are set according to the culture given by the language code of your document but can be changed.

 

The format descriptor starts by \# for numeric formats and by \@ for date formats.

Examples:

- Currency format: \# c

 

- Long date format: \@ "dddd, MMMM d, yyyy" (Friday, April 5, 2013)

 

Formats fully supported by QDV7, but not directly by Word:

Standard numeric formats: http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx

Custom numeric formats: http://msdn.microsoft.com/en-us/library/0c899ak8.aspx

Standard date and time formats: http://msdn.microsoft.com/en-us/library/az4se3k1.aspx

Custom date and time formats: http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx

 

Here are two examples of field codes in Word:

{ MERGEFIELD  Price \# $,#.00  \* MERGEFORMAT }

{ MERGEFIELD  Date \@ yyyy-MM-dd  \* MERGEFORMAT }

 

\* MERGEFORMAT indicates that the format of the merge field is kept (color, shape, font, etc.). This setting comes after the format descriptor.