Home arrow GIS Data & Resources arrow Scripts and Code arrow ArcMap Label & .CAL arrow ArcMap: Proper Case Labelling Script (VBScript)
ArcMap: Proper Case Labelling Script (VBScript) PDF Print E-mail

Written by Bert Granberg,

This script can be used to display proper case labels in ArcMap.  Just open the Layer Properties window, click on Labels and then open the Label Expression window, check advanced and copy and paste the code below into the script window. Right now it is set to work on a field called Label but this can easily be changed.

The script will take a value in the LABEL field like "SILVER SHADOWS DR" and display it as "Silver Shadows Dr"

Function FindLabel ( [LABEL] )
   
   dim txt,a,i, labelStr

   txt = [LABEL]

   if (not isnull(txt)) then
   
      if (len(txt) > 0) then
      
         a=Split(txt)

         for i = 0 to ubound(a)

            if (i = 0) then
            
               labelStr = labelStr & " " & UCase(left(a(i),1)) & LCase(right(a(i), len(a(i)) -1))
 
            else
 
               labelStr = labelStr & " " & UCase(left(a(i),1)) & LCase(right(a(i), len(a(i)) -1))
         
            end if

         next

      end if

   end if

   FindLabel = labelStr

End Function

Users' Comments  
 

No comment posted

Add your comment

04, Nov. 2008
Last Updated ( 04, Nov. 2008 )
 
< Prev   Next >

AGRC Contacts | UGIC Contacts

feed image feed image

Utah GIS Portal © 2009 AGRC

Optimized for