Syncfusion.DocIO.Base
Example 


The string that represents the text to be inserted.

InsertText(String) Method

Inserts the specified text to current bookmark.
Syntax
'Declaration
 
Public Overloads Function InsertText( _
   ByVal text As String _
) As IWTextRange
'Usage
 
Dim instance As BookmarksNavigator
Dim text As String
Dim value As IWTextRange
 
value = instance.InsertText(text)
public IWTextRange InsertText( 
   string text
)

Parameters

text
The string that represents the text to be inserted.

Return Value

The IWTextRange object that represents the inserted text.
Example
This example shows how to insert a simple text using BookmarkNavigator.
private void Button1_Click(System.Object sender, System.EventArgs e)
{
    WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
    //Create the bookmark navigator instance to access the bookmark
    BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
    //Move the virtual cursor to the before the end location of the bookmark "Northwind"
    bookmarkNavigator.MoveToBookmark("Northwind");
    //Insert a new text before the bookmark end of the bookmark
    bookmarkNavigator.InsertText(" Northwind Database is a set of tables containing data fitted into predefined categories.");
    document.Save("Result.docx", FormatType.Docx);
    document.Close();
}
Private Sub button_Click(sender As Object, e As EventArgs)
    Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
    'Create the bookmark navigator instance to access the bookmark
    Dim bookmarkNavigator As New BookmarksNavigator(document)
    'Move the virtual cursor to the before the end location of the bookmark "Northwind"
    bookmarkNavigator.MoveToBookmark("Northwind")
    'Insert a new text before the bookmark end of the bookmark
    bookmarkNavigator.InsertText(" Northwind Database is a set of tables containing data fitted into predefined categories.")
    document.Save("Result.docx", FormatType.Docx)
    document.Close()
End Sub
AssemblyVersion

Syncfusion.DocIO.Base: 17.1460.0.47

See Also