Click to return to the Reusing Browser Technology home page    
IHTMLDocument2::get_secur...     IHTMLDocument2::get_style...     IHTMLDocument2 Interface    
Web Workshop  |  Reusing Browser Technology

IHTMLDocument2::get_selection Method


Retrieves an interface pointer to an object representing the active selection. The active selection can be an insertion point, or a highlighted block of text or other elements in the document upon which the user or a script can carry out an action.

Syntax

HRESULT get_selection(
    IHTMLSelectionObject **p
);

Parameters

p
Address of a pointer to an IHTMLSelectionObject interface of the object representing the active selection.

Return Value

Returns S_OK if successful, or an error code otherwise.

Remarks

The selection object identifies the portion of the document to act on, or returns the results of a action.

The user, a script, or an object can create a selection. The user creates a selection by dragging the mouse over a portion of the document. A script or object creates a selection by calling the select method on a text range or similar object.

A document can have only one selection at a time. The selection has a type that determines whether it is empty or contains a contiguous block of consecutive text and/or elements. Although an empty selection contains nothing, it is useful for marking a position in the document.

Windows CE

Windows CE Use version 2.12 and later
Minimum availability Internet Explorer 4.0


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.