Help Center

CTextDocument2.Openmethod

Opens a specified document. There are parameters to specify access and sharing privileges, creation and conversion of the file, as well as the code page for the file.

Windowsmethoddoc-orphan
No implementation located. This member is documented, but the source scan found no matching declaration. It is likely declared in a header this scan does not resolve, or provided by a macro.

Syntax

FUNCTION Open (BYVAL pVar AS VARIANT PTR, BYVAL Flags AS LONG = 0, BYVAL CodePage AS LONG = 0) AS HRESULT

Parameters

NameDescription
pVarA VARIANT that specifies the name of the file to open.
FlagstomRTF: Open as RTF. tomText: Open as text ANSI or Unicode.
CodePageThe code page to use for the file. Zero (the default value) means CP_ACP (ANSI code page) unless the file begins with a Unicode BOM 0xfeff, in which case the file is considered to be Unicode. Note that code page 1200 is Unicode, CP_UTF8 is UTF-8.

Return value

The return value can be an HRESULT value that corresponds to a system error or COM error code, including one of the following values.

Description

Opens a specified document. There are parameters to specify access and sharing privileges, creation and conversion of the file, as well as the code page for the file.

Reference