Export (0) Print
Expand All
Expand Minimize


Inserts a hyperlink on the current selection, or displays a dialog box enabling the user to specify a URL to insert as a hyperlink on the current selection.

C++ Information

Command group CGID_MSHTML (defined in mshtmhst.h)
Symbolic constant IDM_HYPERLINK
User interface Optional. This command displays a dialogue box if the nCmdExecOpt argument of IOleCommandTarget::Exec is set to MSOCMDEXECOPT_DODEFAULT, MSOCMDEXECOPT_PROMPTUSER, or NULL. It does not display a dialogue box if the argument is set to MSOCMDEXECOPT_DONTPROMPTUSER.
IOleCommandTarget::Exec parameters
pvaIn VARIANT of type VT_BSTR that specifies a URL.
pvaOut Set to NULL.
Header file mshtmcid.h
Applies to IHTMLDocument2::execCommand, IHTMLDocument2::queryCommandEnabled, IHTMLDocument2::queryCommandIndeterm, IHTMLDocument2::queryCommandState, IHTMLDocument2::queryCommandSupported, IHTMLDocument2::queryCommandValue, IOleCommandTarget::Exec, IOleCommandTarget::QueryStatus.


pvaIn is only valid if the nCmdExecOpt argument of IOleCommandTarget::Exec is set to MSOCMDEXECOPT_DONTPROMPTUSER . Providing an empty string will create the anchor tag but will leave the name attribute blank.

The HTML generated by this command may vary depending on the version of Windows Internet Explorer.

Minimum Availability

Internet Explorer 4.0 and later.

Community Additions

© 2014 Microsoft