
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
HRESULT select(void);
Highlights the input area of a form element.
- Returns S_OK if successful, or an error value otherwise.
HRESULT add(
IHTMLControlElement *item
);
Adds an element to the collection.
- Returns S_OK if successful, or an error value otherwise.
- item
- Address of the IHTMLControlElement interface to add.
HRESULT remove(
long index
);
Removes an element from the collection.
- Returns S_OK if successful, or an error value otherwise.
- index
- Long integer value containing the index of the element to remove.
See also add
HRESULT item(
long index,
IHTMLElement **pdisp
);
Retrieves an element or a collection from the given collection. The index parameter determines which action to take.
- Returns S_OK if successful, or an error value otherwise.
- 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.
HRESULT scrollIntoView(
VARIANT varargStart
);
Scrolls the object into view, aligning it at either the top or bottom of the window.
- Returns S_OK if successful, or an error value otherwise.
- 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.
HRESULT queryCommandSupported(
BSTR cmdID,
VARIANT_BOOL *pfRet
);
Determines whether the given command is supported.
- Returns S_OK if successful, or an error value otherwise.
- 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.
HRESULT queryCommandEnabled(
BSTR cmdID,
VARIANT_BOOL *pfRet
);
Determines whether the given command is currently available.
- Returns S_OK if successful, or an error value otherwise.
- 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.
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.
- Returns S_OK if successful, or an error value otherwise.
- 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.
HRESULT queryCommandIndeterm(
BSTR cmdID,
VARIANT_BOOL *pfRet
);
Determines whether the given command is in the indeterminate state.
- Returns S_OK if successful, or an error value otherwise.
- 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.
HRESULT queryCommandText(
BSTR cmdID,
BSTR *pcmdText
);
Retrieves the string associated with the given command.
- Returns S_OK if successful, or an error value otherwise.
- 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.
HRESULT queryCommandValue(
BSTR cmdID,
VARIANT *pcmdValue
);
Retrieves the current value of the given command.
- Returns S_OK if successful, or an error value otherwise.
- 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.
HRESULT execCommand(
BSTR cmdID,
VARIANT_BOOL showUI,
VARIANT value,
VARIANT_BOOL *pfRet
);
Executes the given command over the current selection or text range.
- Returns S_OK if successful, or an error value otherwise.
- 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.
HRESULT execCommandShowHelp(
BSTR cmdID,
VARIANT_BOOL *pfRet
);
Displays help information for the given command identifier.
- Returns S_OK if successful, or an error value otherwise.
- 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.
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.
- Returns S_OK if successful, or an error value otherwise.
- Parent
- Address of a pointer to the IHTMLElement interface of the element.
HRESULT get_length(
long *p
);
Retrieves the number of elements in the collection.
- Returns S_OK if successful, or an error value otherwise.
- p
- Address of a long integer variable that receives the number of elements.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.