Help Center

CRichEditCtx.LoadRtfFromFilemethod

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 LoadRtfFromFile (BYREF wszFileName AS WSTRING) AS BOOLEAN
Also documented as GetRtf — one description covers them all.

Parameters

NameDescription
dwOptionsAndFlagsSpecifies the data format and replacement options.
wszFileNameThe name of the RTF file to load.

Return value

Returns the retrieved text or a null string.

If the operation succeeds, the return value is TRUE. If the operation fails, the return value is FALSE.

Description

Retrieves RTF formatted text from a Rich Edit control.

The SF_RTFNOOBJS option is useful if an application stores COM objects itself, as RTF representation of COM objects is not very compact. The control word, \objattph, followed by a space denotes the object position.

In addition, you can specify the following flags.

Remarks

First you have to create an instance of the CRichEditOleCallback class and pass a pointer to it to the rich edit control using the SetOleCallback method. Then load the .rtf file using the LoadRtfFromFile method.

Examples

DIM pRichEditOleCallback AS CRichEditOleCallback = CRichEditOleCallback pRichEdit.SetOleCallback(@pRichEditOleCallback)

pRichEdit.LoadRtfFromFile(<path and name of the RTF file>) e.g. pRichEdit->LoadRtfFromFile(AfxGetExePath & "\Test.rtf")

Reference

  • Documented in Windows/WIndows Controls/RichEdit/CRichEditCtx Class.md
  • Topic: CRichEditCtx Class