IHTMLControlRange

IHTMLControlRange


The IHTMLControlRange interface contains a range of control type elements. This interface is used for control selection and represents an array of controls that can be operated on as a group.

IHTMLControlRange Methods
select   add   remove  
item   scrollIntoView   queryCommandSupported  
queryCommandEnabled   queryCommandState   queryCommandIndeterm  
queryCommandText   queryCommandValue   execCommand  
execCommandShowHelp   commonParentElement   get_length  

IHTMLControlRange::select

HRESULT select(void);

Highlights the input area of a form element.

IHTMLControlRange::add

HRESULT add(
    IHTMLControlElement *item
);

Adds an element to the collection.

item
Address of the IHTMLControlElement interface to add.

IHTMLControlRange::remove

HRESULT remove(
    long index
);

Removes an element from the collection.

index
Long integer value containing the index of the element to remove.

See also add

IHTMLControlRange::item

HRESULT item(
    long index, 
    IHTMLElement **pdisp
);

Retrieves an element or a collection from the given collection. The index parameter determines which action to take.

index
Long integer value containing the zero-based index of the item to retrieve.
pdisp
Address of a pointer to the IHTMLElement interface for the element or collection.

IHTMLControlRange::scrollIntoView

HRESULT scrollIntoView(
    VARIANT varargStart
);

Scrolls the object into view, aligning it at either the top or bottom of the window.

varargStart
Boolean value specifying whether to place the object at the top of the window or at the bottom. If TRUE, the method scrolls the object so that its top is visible at the top of the window. If FALSE, the bottom of the object is visible at the bottom of the window. If no value is given, the object scrolls to the top by default.

Depending on the size of the given object and the current window, this method may not be able to put the item at the very top or very bottom, but will position the object as close to the requested position as possible.

IHTMLControlRange::queryCommandSupported

HRESULT queryCommandSupported(
    BSTR cmdID, 
    VARIANT_BOOL *pfRet
);

Determines whether the given command is supported.

cmdID
String value containing the identifier of a command. Can be any command identifier given in the list of Command Identifiers.
pfRet
Address of a Boolean variable that receives TRUE if the command is supported, or FALSE otherwise.

IHTMLControlRange::queryCommandEnabled

HRESULT queryCommandEnabled(
    BSTR cmdID, 
    VARIANT_BOOL *pfRet
);

Determines whether the given command is currently available.

cmdID
String containing an identifier of a command. Can be any command identifier given in the list of Command Identifiers.
pfRet
Address of a Boolean variable that receives TRUE if the command is available, or FALSE otherwise.

IHTMLControlRange::queryCommandState

HRESULT queryCommandState(
    BSTR cmdID, 
    VARIANT_BOOL *pfRet
);

Retrieves the current status of the given command. The status indicates whether the command has been carried out on the object.

cmdID
String value containing an identifier of a command. Can be any command identifier given in the list of Command Identifiers.
pfRet
Address of a Boolean variable that receives TRUE if the given command has been carried out, FALSE if it has not, or NULL if the function cannot determine the status of the command.

IHTMLControlRange::queryCommandIndeterm

HRESULT queryCommandIndeterm(
    BSTR cmdID, 
    VARIANT_BOOL *pfRet
);

Determines whether the given command is in the indeterminate state.

cmdID
String value containing an identifier of a command. Can be any command identifier given in the list of Command Identifiers.
pfRet
Address of a Boolean variable that receives TRUE if the given command is in the indeterminate state, or FALSE otherwise.

IHTMLControlRange::queryCommandText

HRESULT queryCommandText(
    BSTR cmdID, 
    BSTR *pcmdText
);

Retrieves the string associated with the given command.

cmdID
String value containing an identifier of a command. Can be any command identifier given in the list of Command Identifiers.
pcmdText
Address of a Boolean variable that receives the command string.

IHTMLControlRange::queryCommandValue

HRESULT queryCommandValue(
    BSTR cmdID,
    VARIANT *pcmdValue
);

Retrieves the current value of the given command.

cmdID
String identifier of a command. Can be any command identifier given in the list of Command Identifiers.
pcmdValue
Address of a Boolean variable that receives a string representing the command value. If the command is not supported, this variable receives NULL.

IHTMLControlRange::execCommand

HRESULT execCommand(
    BSTR cmdID, 
    VARIANT_BOOL showUI, 
    VARIANT value, 
    VARIANT_BOOL *pfRet
);

Executes the given command over the current selection or text range.

cmdID
String identifier of a command. Can be any command identifier given in the list of Command Identifiers.
showUI
Boolean value specifying whether to display a user interface if the command supports one. If TRUE, the command displays a user interface, if applicable; otherwise, it doesn't.
value
VARIANT structure containing a value to pass to the command. Possible values depend on the value of cmdID.
pfRet
Address of a Boolean variable that receives TRUE if the function is successful, or FALSE otherwise.

IHTMLControlRange::execCommandShowHelp

HRESULT execCommandShowHelp(
    BSTR cmdID, 
    VARIANT_BOOL *pfRet
);

Displays help information for the given command identifier.

cmdID
String identifier of a command. Can be any command identifier given in the list of Command Identifiers.
pfRet
Address of a Boolean variable that receives TRUE if successful, or FALSE otherwise.

IHTMLControlRange::commonParentElement

HRESULT commonParentElement(
    IHTMLElement **Parent
);

Retrieves the interface to the first parent element that contains all the controls that are currently stored in this range and within its scope.

Parent
Address of a pointer to the IHTMLElement interface of the element.

IHTMLControlRange::get_length

HRESULT get_length(
    long *p
);

Retrieves the number of elements in the collection.

p
Address of a long integer variable that receives the number of elements.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.