Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ITextDocument::Save method

Saves the document.

Syntax


HRESULT Save(
  [in]  VARIANT *pVar,
  [in]  long Flags,
  [in]  long CodePage
);

Parameters

pVar [in]

Type: VARIANT*

The save target. This parameter is a VARIANT, which can be a file name, or NULL.

Flags [in]

Type: long

File creation, open, share, and conversion flags. For a list of possible values, see ITextDocument::Open.

CodePage [in]

Type: long

The specified code page. Common values are CP_ACP (zero: system ANSI code page), 1200 (Unicode), and 1208 (UTF-8).

Return value

Type: HRESULT

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

Return codeDescription
S_OK

Method succeeds.

E_INVALIDARG

Invalid argument.

E_OUTOFMEMORY

Insufficient memory.

E_NOTIMPL

Feature not implemented.

 

Remarks

To use the parameters that were specified for opening the file, use zero values for the parameters.

If pVar is null or missing, the file name given by this document's name is used. If both of these are missing or null, the method fails.

If pVar specifies a file name, that name should replace the current Name property. Similarly, the Flags and CodePage arguments can overrule those supplied in the ITextDocument::Open method and define the values to use for files created with the ITextDocument::New method.

Unicode plain-text files should be saved with the Unicode byte-order mark (0xFEFF) as the first character. This character should be removed when the file is read in; that is, it is only used for import/export to identify the plain text as Unicode and to identify the byte order of that text. Microsoft Notepad adopted this convention, which is now recommended by the Unicode standard.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Tom.h

DLL

Msftedit.dll

See also

Reference
ITextDocument
New
Open
Conceptual
Text Object Model

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.