InsertLine

This method inserts a line at the specified line index in a field.

Syntax

InsertLine (LineIndex as Long)
Parameter Description
LineIndex Zero-based line index that specifies the position of the line to insert.

Sample Code

Use the following sample code to insert new lines to a field.

'This loop deletes the existing line objects in the field:
Dim lngLineCounter as Long
For lngLineCounter = (pField.LineCount - 1) To 0 Step -1
   pField.DeleteLine(lngLineCounter)
Next
'Then add as many lines as required and populate with the required string:
pField.InsertLine(0)
pField.Line(0)="Line1"
pField.InsertLine(1)
pField.Line(1)="Line2"
'Attempting to use pfield.text="Line1" + VbCrLf & "Line2" does not work.