RichEdit Interface Reference

RichEdit control is a control in which the user can enter and edit text. More...

Inheritance diagram for RichEdit:

Inheritance graph
Collaboration diagram for RichEdit:

Collaboration graph
List of all members.

Public Member Functions

 FindText ([in] BSTR Text,[in, defaultvalue(FR_DOWN)] ULONG Flags,[in, defaultvalue(0)] LONG MinPos,[in, defaultvalue(-1)] LONG MaxPos,[out, retval] LONG *pResult)
 The method finds a text within a rich edit control.
 Load ([in] VARIANT Stream,[in, defaultvalue(SF_RTF)] ULONG Flags,[out, retval] VARIANT_BOOL *pResult)
 Loads a text from a stream.
 Save ([in] VARIANT Stream,[in, defaultvalue(SF_RTF)] ULONG Flags,[out, retval] VARIANT_BOOL *pResult)
 Saves a text to the stream.
 Redo (void)
 Redo the next action in the control's redo queue.
 Print ([in] BSTR Driver,[in] BSTR Device,[in] IDispatch *PrintInfo,[in, defaultvalue(FALSE)] VARIANT_BOOL Selection)
 Prints a text on a printer.

Properties

IDispatch *RW SelFont []
 Specifies the Font for a selection.
IDispatch *R Paragraph []
 Specifies the Paragraph object that can be used for changing a paragraph options.
VARIANT_BOOL RW AutoURLDetect []
 Specifies automatic URL detection.
VARIANT_BOOL R CanRedo []
 Determines whether there are any actions in the control redo queue.
ULONG RW UndoLimit []
 Specifies the undo limit for the control.
VARIANT W OnSelChange []
 Sets the event handler for the OnSelChange event.
ULONG RW PageRotate []
 Specifies text rotation.
ULONG R UndoName []
 Returns the type of the next undo action.
BSTR R UndoNameString []
 Returns the type of the next undo action as a string.

Detailed Description

RichEdit control is a control in which the user can enter and edit text.

RichEdit control supports additional text and paragraph formatting options.

When the user changes a text, the OnChange event occur.

See also the CreateRichEdit method of the Frame.

Example (JScript):

o = new ActiveXObject("Scripting.WindowSystemObject")

f = o.CreateForm(0,0,0,0)

f.ClientWidth = 300
f.ClientHeight = 200
f.CenterControl()

r = f.CreateRichEdit(10,10,400,100)
r.Align = o.Translate("AL_CLIENT")

r.Font.Size = 14

r.Add("Line 1")

r.SelFont.Color = 0x00FF0000

r.Add("Line 3")

r.SelFont.Bold = true
r.SelFont.Color = 0x000000FF
r.SelFont.Size = 16

r.Add("Line 2")

f.Show()

o.Run()

Result:

RichEdit.jpg


Member Function Documentation

FindText ( [in] BSTR  Text,
[in, defaultvalue(FR_DOWN)] ULONG  Flags,
[in, defaultvalue(0)] LONG  MinPos,
[in, defaultvalue(-1)] LONG  MaxPos,
[out, retval] LONG *  pResult 
)

The method finds a text within a rich edit control.

Parameters:
Text text.
Flags This parameter can be a combination of the following values:
  • FR_DOWN If set, the search is from the end of the current selection to the end of the document, otherwise, the search is from the end of the current selection to the beginning of the document.
  • FR_WHOLEWORD If set, the method searches only for whole words that match the search text.
  • FR_MATCHCASE If set, the search operation is case-sensitive, otherwise, the search operation is case-insensitive.
MinPos Specifies the starting point of the search.
MaxPos Specifies the ending point of the search (-1 - search to the end of the text).
Return values:
pResult Zero-based position of the first character of the match, -1 if the text not found.

Load ( [in] VARIANT  Stream,
[in, defaultvalue(SF_RTF)] ULONG  Flags,
[out, retval] VARIANT_BOOL *  pResult 
)

Loads a text from a stream.

Parameters:
Stream The Stream, may be a TextStream object, created by the OpenTextFile method of the FileSystemObject object (See Microsoft Platform SDK).
Flags This parameter can be one of the following values:

Additional flags may be specified:

Return values:
pResult TRUE undicates that the load operation successful.

Print ( [in] BSTR  Driver,
[in] BSTR  Device,
[in] IDispatch *  PrintInfo,
[in, defaultvalue(FALSE)] VARIANT_BOOL  Selection 
)

Prints a text on a printer.

Parameters:
Driver Printer driver.
Device Printer.
PrintInfo PrintInfo object.
Selection - "TRUE" - prints only current selection. "FALSE" - prints all text.
Since:
1.1.6.

Redo ( void   ) 

Redo the next action in the control's redo queue.

Save ( [in] VARIANT  Stream,
[in, defaultvalue(SF_RTF)] ULONG  Flags,
[out, retval] VARIANT_BOOL *  pResult 
)

Saves a text to the stream.

Parameters:
Stream The Stream, may be a TextStream object, created by the OpenTextFile method of the FileSystemObject object (See Microsoft Platform SDK).
Flags This parameter can be one of the following values:
Additional flags may be specified:

Return values:
pResult TRUE undicates that the save operation successful.


Property Documentation

VARIANT_BOOL RW AutoURLDetect

Specifies automatic URL detection.

Default value: FALSE.

VARIANT_BOOL R CanRedo

Determines whether there are any actions in the control redo queue.

If the redo queue is not empty, you can use the Redo method.

VARIANT W OnSelChange

Sets the event handler for the OnSelChange event.

ULONG RW PageRotate

Specifies text rotation.

This parameter can be one of the following values:

Requires Windows XP SP1. Requires RichEdit version 5 (See CreateRichEdit).

Since:
1.1.8.

IDispatch* R Paragraph

Specifies the Paragraph object that can be used for changing a paragraph options.

IDispatch* RW SelFont

Specifies the Font for a selection.

Default font specified by the Font property of the Control.

Note:
When the current selection changes the SelFont is updated.

ULONG RW UndoLimit

Specifies the undo limit for the control.

Default value: 100.

ULONG R UndoName

Returns the type of the next undo action.

This parameter can be one of the following values:

BSTR R UndoNameString

Returns the type of the next undo action as a string.

See also:
UndoName
Since:
1.1.8.


WSO 1.1 Documentation. Date modified:Wed Aug 12 18:13:06 2015. (C) Veretennikov A. B. 2004-2015