Previous Document Next Document

Object Model Reference : Classes : T : Text : Methods : Text.ImportFromFile


Text.ImportFromFile

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

Description

Member of Text

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

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

VBA example

The following VBA example saves the second-to-fifth paragraphs to a text file, and it then inserts that text at the beginning of the text object.

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 2013 Corel Corporation. All rights reserved.