EN
このコンテンツは設定された言語で表示できません。英語版のページが表示されます。

queryCommandEnabled method

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

Syntax


 retVal = object.queryCommandEnabled(cmdID);

Parameters

cmdID [in]

Type: BSTR

BSTR that specifies a command identifier.

Standards information

There are no standards that apply here.

Remarks

Using IHTMLDocument2::queryCommandEnabled ("delete") on a TextRange object returns VARIANT_TRUE, while IHTMLDocument2::queryCommandEnabled ("delete") on a document object returns VARIANT_FALSE. However, IHTMLDocument2::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

Reference
IHTMLDocument2::execCommand
IHTMLDocument2::queryCommandIndeterm
IHTMLDocument2::queryCommandState
IHTMLDocument2::queryCommandSupported
IHTMLDocument2::queryCommandValue

 

 

コミュニティの追加

追加
表示:
© 2014 Microsoft