Appending and Inserting Text Files

The first thing required in order to insert a file into your document is to specify the location where it is to be inserted. This is done using the Selection.Start property. Having set the input position to the desired location, the Selection.Load method can be used to insert a file, string or image. In this sample, first an RTF file is loaded, and then a HTML file is appended to its end.

[C#]
textControl1.Load ("..\\..\\TestFiles\\Caption.rtf",
    TXTextControl.StreamType.RichTextFormat);
textControl1.Selection.Start = textControl1.Text.Length; 
textControl1.Selection.Load ("..\\..\\TestFiles\\Net.htm",
TXTextControl.StreamType.HTMLFormat);
[Visual Basic]
TextControl1.Load("..\TestFiles\Caption.rtf", _
    TXTextControl.StreamType.RichTextFormat)
TextControl1.Selection.Start = TextControl1.Text.Length
TextControl1.Selection.Load("..\TestFiles\Net.htm", _
TXTextControl.StreamType.HTMLFormat)

<< Previous Next >>