Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
HtmlDocument Class
 ExecCommand Method
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
HtmlDocument..::.ExecCommand Method

Executes the specified command against the document.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)
Visual Basic (Declaration)
Public Sub ExecCommand ( _
    command As String, _
    showUI As Boolean, _
    value As Object _
)
Visual Basic (Usage)
Dim instance As HtmlDocument
Dim command As String
Dim showUI As Boolean
Dim value As Object

instance.ExecCommand(command, showUI, _
    value)
C#
public void ExecCommand(
    string command,
    bool showUI,
    Object value
)
Visual C++
public:
void ExecCommand(
    String^ command, 
    bool showUI, 
    Object^ value
)
JScript
public function ExecCommand(
    command : String, 
    showUI : boolean, 
    value : Object
)

Parameters

command
Type: System..::.String
The name of the command to execute. For a full list of commands, see Command Identifiers on MSDN.
showUI
Type: System..::.Boolean
Whether or not to show command-specific dialog boxes or message boxes to the user.
value
Type: System..::.Object
The value to assign using the command. Not applicable for all commands.

ExecCommand exposes a large array of commands for which there are no methods exposed on HtmlDocument. Using ExecCommand you can insert new HTML elements, select and format text, and clear any cached authentication credentials.

NoteNote:

Certain commands, such as copy, have return values. In the current implementation of ExecCommand, you cannot obtain a return value from your call. To retrieve return values, use the corresponding unmanaged method on a DomDocument reference instead.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Dead link: command identifiers      JoachimP ... m. charmois   |   Edit   |   Show History
In the description of the command parameter, the command identifiers link and URL (i.e. to http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/commandids.asp) leads to an error page on the japanese MSDN web site. Where can I find this info today?

[tfl - 25/6/08] Good catch - flagging this as contentbug for MS to find/fix

Anybody found yet that very command list?

Hi,
Here is the link:
http://msdn.microsoft.com/en-us/library/ms533049.aspx

For people working on this topic, I recommend two good posts:
http://www.codeproject.com/KB/edit/editor_in_windows_forms.aspx
http://www.codeproject.com/KB/IP/WYSIWYG_netHTML2.aspx?fid=439917&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=2674936
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker