You can add a new line to a text string by including vbCrLf in the string.
Plot.Shapes.AddText("line1" & vbCrLf & "line2")
The vbCrLf constant consists of a carriage return Chr(13) and a line feed Chr(10). For more information about Visual Basic string constants, refer to the BASIC Language Help accessed from the Scripter Help menu.
Sub Main Dim SurferApp, Plot, Text, FontFormat As Object Set SurferApp = CreateObject("Surfer.Application") SurferApp.Visible=True Set Plot = SurferApp.Documents.Add Set Text = Plot.Shapes.AddText(5,7, "This is my text"& vbCrLf & "This is my text on the second line") Set FontFormat = Text.Font FontFormat.HAlign = srfTACenter End Sub
Updated February 14, 2017