AddText

AddText adds new text. Returns a Text object.

Syntax

object.AddText( x, y, Text )

Parameter

Type

Default

Description

x

Double

 

required; This provides the X coordinate of the point where the text is to be inserted.

y

Double

 

required; This provides the Y coordinate of the point where the text is to be inserted.

Text

String

 

required; This provides the text string to be inserted (use double quotes).

Remarks

Either page units or map coordinates are used for the vertices. When the text is added to the plot, use page units for the coordinates. When the text is added to a map layer, use map coordinates to specify the coordinates.

Use FontFormat to change the text properties. The text string is placed on the XY coordinates according to the default HAlign and VAlign values.

Example 1

This example demonstrates how to create a text string.

'declare Text object and create new text

Dim Text As Object

Set Text = Shapes.AddText(x:=5, y:=7, Text:="This is a string of text")

Example 2

This script displays all the methods and properties in the Shapes collection.

Used by: Shapes collection