Knowledge Base - Technical Articles
HowTo: Use advanced label expressions in ArcMap
| Article ID: | 17149 |
|---|---|
| Software: | ArcGIS - ArcEditor 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10 ArcGIS - ArcInfo 8.0.1, 8.0.2, 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10 ArcGIS - ArcView 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10 ArcGIS for Desktop Advanced 10.1 ArcGIS for Desktop Standard 10.1 ArcGIS for Desktop Basic 10.1 |
| Platforms: | Windows NT 4.0, 2000, XP, Server 2003 |
Summary
VBScript can be used to create advanced label expressions in ArcMap. The label expression can include any valid VBScript statements.
Procedure
- Display the Label Property Sheet for the layer.
-show me- A. Right-click the Layer in the Table of Contents.
B. Click Properties.
C. Select the Labels Tab. - Click the Expression button.
- Create the label expression using VBScript.
-show me- Summary This article contains some syntax examples for creating common advanced label expressions using VBScript. Enter these expressions in the ArcMap Label Expression dialog box.Procedure - Open the Label Expression dialog box in ArcMap.
-show me-
At ArcGIS Desktop versions 8.2 and later, click the Help button on the Label Expression dialog box to display more help on advanced label expressions.
- Use an ampersand (&) to append a text string to the Label Field.
"Name: " & [Name]
- Use the UCase function to convert the Label Field to upper case.
UCase([Name])
- Create a multiple-line label using the VbNewLine keyword.
"Name: " & [Name] & vbNewLine & "Type: " & [Type]
- Use the FormatCurrency function to display the Label as currency.
"Occupancy Revenue: " & FormatCurrency( [Maximum_Oc] * [Rate])
- Use the FormatNumber function to display labels for numeric items with trailing zeros.
"Occupancy: " & FormatNumber([OCCUPANCY_RATE],3)
- Open the Label Expression dialog box in ArcMap.
Related Information
Created: 3/5/2001
Last Modified: 11/9/2012
By Anonymous - 09/04/2009 9:38 AM
The article has missing, misleading, or conflicting information.
The link in the related information is broken.