AddText

The AddText method adds new text. Returns a Text object.

 

Syntax

object.AddText( x, y, Text, UnitType )

 

Parameter

Type

Description

x

Double

required; X coordinate position in page units

y

Double

required; Y coordinate position in page units

Text

String

required; text string (use double quotes)

UnitType

MVCoordDisplayUnits

optional; unit type, default is mvCoordDisplayUnitPageUnits

 

Remarks

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

This example demonstrates how to create a text string.

 

Dim Text As Object

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

 

Used by: Shapes collection