Share via


_Application3.FormatString Method

Formats the specified string or XML node according to the specified category and options parameters.

Namespace: Microsoft.Office.Interop.InfoPath
Assembly: Microsoft.Office.Interop.InfoPath (in microsoft.office.interop.infopath.dll)

Syntax

'Declaration
'Usage

Parameters

  • varInput
    The value or XML node to be formatted.
  • bstrCategory
    The value that specifies the category used for formatting. Values include number, percentage, currency, date, time, and datetime.
  • bstrOptions
    The value that specifies the options used for formatting. Takes the form of a case-sensitive string in the format "optionName:value".

Return Value

The specified string or XML node formatted according to the specified category and options parameters.

Remarks

The FormatString method can be used anywhere you need to change the format of a specified string. It must be qualified with the Application name, and its return value must be assigned to a variable or used as an expression that requires a string value.

The following tables list the values that may be used for bstrCategory and bstrOptions:

Example

In the following example, the FormatString method of the Application object is used to format the specified date string into a long date format:

thisApplication.FormatString("2003-01-08", "date", "dateFormat:Long Date");

See Also

Reference

_Application3 Interface
_Application3 Members
Microsoft.Office.Interop.InfoPath Namespace