Previous Document Next Document

Object Model Reference : Classes : T : TextRange : Methods : TextRange.InsertBefore


TextRange.InsertBefore

Function InsertBefore(Text As String, [LanguageID As cdrTextLanguage = cdrLanguageNone], [CharSet As cdrTextCharSet = cdrCharSetMixed], [Font As String]) As TextRange

Description

Member of TextRange

The InsertBefore method inserts new text before the first character in the text range, returning a text range that contains only the inserted characters.

Parameter
Description
Text
Specifies the text to insert
LanguageID
Specifies the language code. This parameter is optional, and its default value is cdrLanguageNone (0).
CharSet
Specifies the character set. This parameter is optional, and its default value is cdrCharSetMixed (-1).
Font
Specifies the font. This parameter is optional.

VBA example

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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.