API Documentation > CorelDRAW > 2025-v26 > TextRange > IVGTextRange
TextRange.InsertBefore method
Inserts the new text before first character in the range and returns a range containing only the inserted characters
Syntax:
Function InsertBefore(ByVal Text As String, Optional ByVal LanguageID As cdrTextLanguage = cdrLanguageNone, Optional ByVal CharSet As cdrTextCharSet = cdrCharSetMixed, Optional ByVal Font As String) As TextRange
Parameters:
Name Type Description
Text
String
LanguageID
Specifies the language code.
CharSet
Specifies the character set.
Font
String
Remarks:
The InsertBefore method inserts new text before the first character in the text range, returning a text range that contains only the inserted characters.
Examples:
The following VBA example inserts the sentence This will be inserted first. before the paragraph text This is an example.
Sub Test()
Dim d As Document
Dim s As Shape
Dim t As Text
Set d = CreateDocument
Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, _
  "This is an example.")
Set t = s.Text
t.Story.InsertBefore ("This will be inserted first. ") 
End Sub