This sample demonstrates a way to create a spline text tool in ArcMap using VBA. A new Polyline or BezierCurve can be tracked to create the path for the text, or an existing graphic element may provide the path.

How to use:
  1. In ArcMap, Select Tools, Customize, and then select the Commands tab and scroll down to UIControls in the left pane.
  2. Click NewUIControl, and select New UIToolControl and then click Create. Drag the new tool onto a toolbar of your choosing.
  3. Repeat the above step, adding a New UIComboBoxControl this time.
  4. Dismiss the Customize dialog, and open the VBA Editor window (Tools->Macros->Visual Basic Editor or ALT+F11)
  5. Copy and paste the code from SplineText.cls below into the ThisDocument code window. Close the VBA Editor window (this is essential for the UIToolControl to operate correctly).
  6. Change ActiveView, or run the Macro PopulateCombo to populate the new UIComboBoxControl
  7. Select the new UIToolControl, and track a BezierCurve on the active view. Double-click to finish the line, and then start typing to create a splined text path. Press Return to finish the text.
  8. Select "New Line" from the new UIComboBoxControl, and repeat the process, this time creating a line instead of a curve.
  9. Now use the Select Graphics tool to select a single graphic from the view (use the New Rectangle, New Polyline, New Ellipse etc tools to create them if you need to).
  10. Select "Use currently selected graphic" from the UIComboBoxControl, and then select the UIToolControl. Start tying your text, and hit return to finish.


Requires: An ArcMap session with a UIToolControl and a UIComboBoxControl

Difficulty: Intermediate

Visual Basic
File Description
SplineText.cls ArcMap VBA code for the spline text tool

Key CoClasses: TextPath, TextSymbol, NewBezierCurveFeedback, NewLineFeedback
Key Interfaces: ISimpleTextSymbol, ITextPath, ICurve, INewBezierCurveFeedback, INewLineFeedback, IGraphicsContainerSelect
Key Members: ISimpleTextSymbol::TextPath