CRichEditCtx.LoadRtfFromFilemethod
Syntax
FUNCTION LoadRtfFromFile (BYREF wszFileName AS WSTRING) AS BOOLEAN
GetRtf — one description covers them all.Parameters
| Name | Description | |
|---|---|---|
dwOptionsAndFlags | Specifies the data format and replacement options. | |
wszFileName | The 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