Text Object
The Text object represents a stand-alone text object in the document. Text objects are created by the Shapes.AddText method.
Derived from: Shape object(All methods and properties of Shape apply to this object.)
The following table provides all the properties of the Text object.
Property |
Description |
Returns the font format object. It is a read-only property. |
|
Returns/sets the text string. |
Example
The following script demonstrates how the Text object is used in reference to the Shapes collection.
Sub Main
'Declares SurferApp as an object
Dim SurferApp As Object
'Creates an instance of the Surfer Application object and assigns it
'to the variable named "SurferApp"
Set SurferApp = CreateObject("Surfer.Application")
'Makes Surfer visible
SurferApp.Visible = True
'Declares Plot as an object
Dim Plot As Object
'Creates a plot document in Surfer and assigns it to the variable
'named "Plot"
Set Plot = SurferApp.Documents.Add(srfDocPlot)
'Declares Shapes as an object
Dim Shapes As Object
'Assigns the Shapes collection to the variable named "Shapes"
Set Shapes = Plot.Shapes
'Declares Text as an object
Dim Text As Object
'Creates a text string and assigns it to the variable named "Text"
Set Text = Shapes.AddText(x:=5, y:=7, Text:="This is a string of text")
End Sub