Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

queryCommandEnabled method

Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.

Syntax

object.queryCommandEnabled(cmdID)

Parameters

cmdID [in]

Type: String

String that specifies a command identifier.

Return value

Type: Boolean

Boolean that returns one of the following possible values:

Return valueDescription
true

The command is enabled.

false

The command is disabled.

 

Standards information

There are no standards that apply here.

Remarks

Using queryCommandEnabled ("delete") on a TextRange object returns true, while queryCommandEnabled ("delete") on a document object returns false. However, execCommand ("delete") can still be used to delete the selected text.

This method is a wrapper function for the QueryStatus method to enable scriptable execution of some command constants. You can obtain an IOleCommandTarget interface by calling QueryInterface on the IHTMLDocument2 interface using IID_IHTMLDocument2 for the IID.

This method is a wrapper function for the QueryStatus method to enable scriptable execution of some command constants. You can obtain an IOleCommandTarget interface by calling QueryInterface on the IHTMLControlRange interface using IID_IHTMLControlRange for the IID.

This method is a wrapper function for the QueryStatus method to enable scriptable execution of some command constants. You can obtain an IOleCommandTarget interface by calling QueryInterface on the IHTMLTxtRange interface using IID_IHTMLTxtRange for the IID.

See also

controlRange
document
TextRange
Reference
execCommand
queryCommandIndeterm
queryCommandState
queryCommandSupported
queryCommandValue

 

 

Show:
© 2014 Microsoft