Its been touched on in some of the archived posts, but I can't seem to get this to work.
I want to label some points using the contents of a single text field. I'm familiar with using vbnewline for doing this with seperate fields, its quite simple. But i'd like to be able to stack labels based on inserting a symbol of some description (e.g. '/' or '*') into the single field
"Started 2010 / under construction / still waiting on management approval" to look like this:
Started 2010 under construction still waiting management approval
I found the following vbscript example in an archived thread:
Function FindLabel ( [myField] ) FindLabel = Replace( [myField], "/", vbCrLf) End Function
But the expression editor says that using the Replace command is incorrect.
I've just tested using the script code you've posted and it works fine. I use ArcGIS 10 SP3. What's about you?
The workflow I use is: Layer Properties > check the Label features in this layer check box. Click the Expression button > check the Advanced check box > copy the code into the Expression text box. This is it. I guess you have not checked the Advanced option, so the parser cannot be used. Also make sure that the VBScript is used for Parser: option.
Function FindLabel ( [FieldName] )
FindLabel = Replace( [FieldName] , "/", vbCrLf)
It looks like it counts characters and finds spaces so that the wrap starts in a logical place. You can adjust the length of the wrap. If your data have a typical length and are in one field, this might work. If your data have variable lengths, what you have would likely work better.