File: xdmthFormatString.htm

package info (click to toggle)
office2003-schemas 1.0%2Bds-1
  • links: PTS, VCS
  • area: non-free
  • in suites: bookworm, forky, sid, trixie
  • size: 42,304 kB
  • sloc: javascript: 2,429; makefile: 29
file content (11 lines) | stat: -rw-r--r-- 10,117 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
<html dir="ltr"><head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="assetid" CONTENT="HV01025232"><META NAME="lcid" CONTENT="1033"><title>FormatString Method</title><link rel="stylesheet" type="text/css" href="office10.css"><script type="text/javascript" language="Javascript" src="ExpCollapse.js"></script><script type="text/javascript" language="JavaScript" src="inline.js"></script></head><body><p id="ExpandAllLine" class="ExpFav"><a href="#" onclick="ExpandAll()" onkeypress="ExpandAll()" class="DropDown"><img id="picHeader" border="0" src="expandtri.gif" alt="Show All"><span id="ExpandAll">Show All</span></a></p><h1>FormatString Method</h1><DIV class="ofvbanav"><span class="ofvbanavreuse" id="seealso" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="appliesto" onclick="toggleList()" onkeypress="toggleList()"></span><a class="ofvbanavex" href="#example"><span class="ofvbanavreuse" id="example"></span></a><span class="ofvbanavreuse" id="specifics" onclick="toggleList()" onkeypress="toggleList()"></span></DIV><p><p>Formats the specified string or XML node according to the specified category and options parameters.</p><p class="signature"><i>expression</i>.<b class="bterm">FormatString</b>(ByVal <b class="bterm"><i>varInput</i></b>, ByVal <b class="bterm"><i>bstrCategory</i></b> As String, ByVal <b class="bterm"><i>bstrOptions</i></b> As String) As String</p><p><i>expression   </i> Required. An expression that returns a reference to the <b class="bterm"><a href="xdobjApplication.htm" id="HV01021256" lcid=" ">Application</a></b> object.</p><p><b class="bterm"><i>varInput</i></b> Required <b class="bterm">String</b> or <b class="bterm">XML node</b>. The string value or XML node to be formatted.</p><p><b class="bterm"><i>bstrCategory</i></b> Required <b class="bterm">String</b>. The string value that specifies the category used for formatting. Values include <b class="bterm">number</b>, <b class="bterm">percentage</b>, <b class="bterm">currency</b>, <b class="bterm">date</b>, <b class="bterm">time</b>, and
					<b class="bterm">datetime</b>.</p><p><b class="bterm"><i>bstrOptions</i></b> Required <b class="bterm">String</b>. The string value that specifies the options used for formatting. Takes the form of a case-sensitive string in the format  "optionName:value". </p><p><i>returns   </i>
					<b class="bterm">String</b>.</p></p><h2>Security Level</h2><p>0: Can be accessed without restrictions.</p><h2>Remarks</h2><p><p>The <b class="bterm">FormatString</b> method can be used anywhere in your scripting code in which you need to change the format of a specified string. It must be qualified with the <b class="bterm">Application</b> object name, and its return value must be assigned to a variable or used as an expression that requires a string value.</p></p><p>The following sections list the values that may be used for the <b class="bterm"><i>bstrCategory</i></b> and <b class="bterm"><i>bstrOptions</i></b> parameters:</p><p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">List of categories</a></p><div id="ExpCol" class="collapsed" border="0"><table><tr><th>Name</th><th>Description</th></tr><tr><td><b class="bterm">number</b></td><td>Uses numerical values. Valid options for this category include <b class="bterm">locale</b>, <b class="bterm">numDigits</b>, <b class="bterm">leadingZero</b>, <b class="bterm">grouping</b>, <b class="bterm">decimalSep</b>, <b class="bterm">thousandSep</b>, and <b class="bterm">negativeOrder</b>.</td></tr><tr><td><b class="bterm">percentage</b></td><td>Uses percentage values. Valid options for this category include <b class="bterm">locale</b>, <b class="bterm">numDigits</b>, <b class="bterm">leadingZero</b>, <b class="bterm">grouping</b>, <b class="bterm">decimalSep</b>, <b class="bterm">thousandSep</b>, and <b class="bterm">negativeOrder</b>.</td></tr><tr><td><b class="bterm">currency</b></td><td>Uses currency values. Valid options for this category include <b class="bterm">locale</b>, <b class="bterm">numDigits</b>, <b class="bterm">leadingZero</b>, <b class="bterm">grouping</b>, <b class="bterm">decimalSep</b>, <b class="bterm">thousandSep</b>, <b class="bterm">negativeOrder</b>, <b class="bterm">positiveOrder</b>, and <b class="bterm">currencyLocale</b>.</td></tr><tr><td><b class="bterm">date</b></td><td>Uses date values. Valid options for this category include <b class="bterm">locale</b>, <b class="bterm">dateFormat</b>, <b class="bterm">useAltCalendar</b>, and <b class="bterm">useEnglishStringsAlways</b>.</td></tr><tr><td><b class="bterm">time</b></td><td>Uses time values. Valid options for this category include <b class="bterm">locale</b>, <b class="bterm">timeFormat</b>, and <b class="bterm">noSeconds</b>.</td></tr><tr><td><b class="bterm">datetime</b></td><td>Uses datetime values. Valid options for this category include <b class="bterm">locale</b>, <b class="bterm">dateFormat</b>, <b class="bterm">timeFormat</b>, <b class="bterm">noSeconds</b>, <b class="bterm">useAltCalendar</b>, and <b class="bterm">useEnglishStringAlways</b>.</td></tr></table></div><p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">List of options</a></p><div id="ExpCol" class="collapsed" border="0"><table><tr><th>Name</th><th>Description</th></tr><tr><td><b class="bterm">locale</b></td><td>Specifies the locale identifier (LCID).  Defaults to the current user's LCID if not specified.</td></tr><tr><td><b class="bterm">numDigits</b></td><td>Specifies the number of fractional digits after the decimal separator. The value <b class="bterm">auto</b> may also be used to indicate that the number of decimal places that was entered will be the number of decimal places in the output. For example, 1.234, 1.234, 1.00, 1.00, 1.56e2, or 156.00. Defaults to the corresponding value in regional settings if not specified.</td></tr><tr><td><b class="bterm">leadingZero</b></td><td>Specifies whether to use leading zeros in decimal fields. Specify 0 to indicate no leading zeros and 1 to indicate leading zeros. Defaults to the corresponding value in regional settings if not specified.</td></tr><tr><td><b class="bterm">grouping</b></td><td>Specifies the size of each group of digits to the left of the decimal. Values in the range 0–9 and value 32 are valid. Value 32 indicates that the grouping is three digits, then two digits thereafter. Defaults to the corresponding value in regional settings if not specified.</td></tr><tr><td><b class="bterm">decimalSep</b></td><td>Specifies the decimal separator string. Defaults to the corresponding value in regional settings if not specified.</td></tr><tr><td><b class="bterm">thousandSep</b></td><td>Specifies the thousands separator string. Defaults to the corresponding value in regional settings if not specified.</td></tr><tr><td><b class="bterm">negativeOrder</b></td><td>Specifies the negative number mode. Defaults to the corresponding value in regional settings if not specified.</td></tr><tr><td><b class="bterm">positiveOrder</b></td><td>Specifies the positive number mode. Defaults to the corresponding value in regional settings if not specified.</td></tr><tr><td><b class="bterm">currencyLocale</b></td><td>Specifies the locale identifier (LCID) for the currency symbol. Defaults to the value specified by locale if not specified.</td></tr><tr><td><b class="bterm">dateFormat</b></td><td>Specifies a format picture string that is used to form the date string. The values <b class="bterm">Short Date</b>, <b class="bterm">Long Date</b>, <b class="bterm">Year Month</b>, and <b class="bterm">none</b> may also be used to indicate short date format, long date format, year month format, and no format, respectively. <b class="bterm">Short Date</b>, <b class="bterm">Long Date</b>, and <b class="bterm">Year Month</b> are the default formats provided by the operating system's regional and language settings.</td></tr><tr><td><b class="bterm">useAltCalendar</b></td><td>Specifies whether to use an alternate calendar for date formatting. Specify 0 to use the normal calendar and 1 to use the alternate calendar. Defaults to 0 if not specified.</td></tr><tr><td><b class="bterm">useEnglishStringsAlways</b></td><td>Specifies whether to always use English strings for date formatting. Specify 0 to use the language specified by locale and 1 to always use English. Defaults to 0 if not specified.</td></tr><tr><td><b class="bterm">timeFormat</b></td><td>Specifies a format string that is used to form the time string. The value <b class="bterm">none</b> may also be used to indicate no format. Defaults to the time format in regional settings if not specified.</td></tr><tr><td><b class="bterm">noSeconds</b></td><td>Specifies whether to not use seconds. Specify 0 to use seconds and 1 to not use seconds. Defaults to 0 if not specified.</td></tr></table></div><h2><a id="#example" name="#example">Example</a></h2><p><p>In the following example, the <b class="bterm">FormatString</b> method of the <b class="bterm">Application</b> object is used to format the specified date string into a long date format:</p><pre><code>Application.<b class="bterm">FormatString</b>("2003-01-08", "date", "dateFormat:Long Date");</code></pre></p><script type="text/javascript" language="JScript" src="ofvbanl.js"></script><span id="ofVBAISpan" class="ofvbaispan"><iframe id="ofVBAIFrame" frameborder="0" marginheight="0" marginwidth="4" scrolling="auto" width="100%" src="../links/xdmthFormatString_l.htm"></iframe></span><center><a href="XMLSchemaCopyright_HV01147162.htm">&copy;2003-2004 Microsoft Corporation. All rights reserved.</a>  

Permission to copy, display and distribute this document is available at: <a 

href="http://r.office.microsoft.com/r/rlidAWSContentRedir?AssetID=XT010988631033&amp;CTT=11&amp;Origin=HV011232471033" 

target="_new">http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp</a></center></body></html>