Previous Document Next Document
Text.ImportFromFile

Sub ImportFromFile(FileName As String, StartIndex As Long, [IndexingType As cdrTextIndexingType = cdrCharacterIndexing])

Member of Text

The ImportFromFile method inserts the contents of a text file into a text block at specified position.

Parameters
Description
FileName
Specifies the full path and filename of the file to import
StartIndex
Specifies the position of the inserted text file
IndexingType
Specifies the type of text to be indexed in the StartIndex parameter . The indexing type can be character, word, or paragraph, and the IndexingType parameter returns a value of cdrTextIndexingType.
This parameter is optional, and its default value is cdrCharacterIndexing (0).

The following code example saves the second-to-fifth paragraphs to a text file, and it then inserts the text at the beginning of the text block:

Sub Test() 
 ActiveShape.Text.ExportToFile "C:\Temp.txt", 2, 4, 
cdrParagraphIndexing 
 ActiveShape.Text.ImportFromFile "C:\Temp.txt", 1, 
cdrParagraphIndexing 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.