I want to update a Text_Element with a newline or page break using ArcGIS Desktop 10.0.

Does anyone know the tag or syntax?


The second example in the online help demonstrates how to add the newline to a text element.

| improve this answer | |
  • Thanks Dan. I was trying /n and <br/> and all that stuff. Your suggestion worked. – Justin Feb 23 '12 at 15:44

Dan is correct (and answered before me), but I had to try this myself, as I assumed that there was no way that a \n would work (that would be too easy!)

I made a textbox, named it "Text", added some text:

enter image description here

Ran this code that Dan points to:

>>> import arcpy
>>> mxd = arcpy.mapping.MapDocument("CURRENT")
>>> elm = arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "Text")[0]
>>> elm.text = 'Date: <dyn type="date" format="short"/> \nTime: <dyn type="time" format=""/>'
>>> arcpy.RefreshActiveView()

And got this:

enter image description here

Also, this seems to only work programmatically; adding a \n in the textbox in ArcMap only outputs the \n as text.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.