Click to return to the DHTML, HTML     
Web Workshop  |  DHTML, HTML & CSS

Document Object API Reference


This document describes technologies that are available in Internet Explorer 5. An earlier version of the DHTML Editing Component that is compatible with Internet Explorer 4.01 is available as an SDK that you can download from here.

Microsoft Corporation

Updated June 11, 1999

The DHTML Editing Component document object exposes several standard OLE interfaces and expects the host to expose others. The Editing Component exposes just one custom interface: ITriEditDocument. This interface contains methods that allow the HTML source to be managed so the document can be properly rendered on the editing surface.

In addition, the DHTML Editing Component document object supports a set of component-specific command IDs that can be passed to the IOleCommandTarget::Exec method. These commands provide facilities to control the editor, format elements, absolutely positioned elements, and manipulate tables. These commands are listed under the topic Document Object Commands.

For an example of an application that is created with the DHTML Editing Component document object, see the CEdit sample application. For more details about sample applications, see "Sample Applications" under Overview of the DHTML Editing Component.

ITriEditDocument Interface

The ITriEditDocument custom interface for the DHTML Editing Component document object allows the HTML source to be managed so the document can be properly rendered on the editing surface.

The interface supports the following methods:

FilterIn, FilterOut

For more details about this interface, see Filtering HTML Source.

ITriEditDocument::FilterIn

HRESULT FilterIn(LPSTREAM pInputStream, LPSTREAM* ppFilteredStream, 
 DWORD dwFlags, BSTR bstrBaseURL);

Passes an HTML stream through one or more filters that modify specific document elements to make them suitable for display and editing in the DHTML Editing Component.

Errors are returned as constants defined in Triedit.idl. For details about getting this include file, see Requirements.

Error Description
E_FILTER_FRAMESET Document contains one or more frame sets.
E_FILTER_SERVERSCRIPT Document contains server script too complex to be parsed.
E_FILTER_MULTIPLETAGS Document contains multiple <BODY>, <HEAD>, <TITLE>, or <HTML> tags.
E_FILTER_SCRIPTLISTING Document contains server script inside a <LISTING> tag.
E_FILTER_SCRIPTLABEL Document contains server script inside a <LABEL> tag.
E_FILTER_SCRIPTTEXTAREA Document contains server script inside a <TEXTAREA> tag.
E_FILTER_SCRIPTSELECT Document contains server script inside a <SELECT> tag.

pInputStream

[in] A Stream object that supports the IStream interface, previously created by the host application. The FilterIn method reads the filtered HTML source from this stream.

ppFilteredStream

[out] A Stream object that supports the IStream interface, previously created by the host application. The FilterIn method loads the filtered HTML source into this stream.

dwFlags

[in] Bitfield identifying the type of filtration to be applied to the contents of pInputStream. For a description of possible flag values, see Remarks below.

bstrBaseURL

[in] String specifying the base URL used to resolve relative references to the original HTML source.

Call this method before calling the IPersistStreamInit::Load method to load the document into the editor.

A host must load the HTML text into memory and create the Stream object for the pInputStream parameter using the OLE API CreateStreamOnHGlobal() function. To ensure that the Stream is sized correctly hosts should call IStream::SetSize with the actual file size before calling the FilterIn method. Load the Stream into the DHTML Editing Component using IPersistStreamInit::Load().

The following table lists values that can be used in the dwFlags parameter. Multiple flags are passed by using an OR operator in the bitfield. Flag values are defined in Triedit.idl.

dwFlags value Description
dwFilterDefaults All source code filtering options are enabled. This is equivalent to (dwFilterDTCs | dwFilterServerSideScripts | dwPreserveSourceCode).
dwFilterNone Does no filtering whatsoever. This flag allows the FilterIn method to be called always, even in cases where no filtering is required.
dwFilterDTCs Enables DTC filtering. Enclosing HTML comments and META tags are stripped from DTC Object tags. When the filtered document is loaded into the DHTML Editing Component, DTCs are instantiated.
dwFilterServerSideScripts Enables Active Server Page script filtering. HTML source code delimited by the ASP delimiters <% and %> is modified such that the delimiters are replaced by HTML SCRIPT tags with the language attribute set to SERVERASP. The script code is enclosed in HTML comments.
dwPreserveSourceCode Enables source code formatting retention.
dwFilterSourceCode Specifies that the content of pInputStream is not a complete HTML document (does not contain <HTML> or <BODY> tags), which is useful if you are passing only a portion of the document. If you do not pass this flag, the FilterIn method adds <HTML> and <BODY> around the filtered text.
dwFilterMultiByteStream Indicates that input Stream argument is an ANSI Stream. The Stream object passed to the ITriEditDocument::FilterIn method is assumed to be Unicode by default.
dwFilterUsePstmNew Indicates that the host is passing a valid Stream in the ppFilteredStream parameter and that it should be used. If this flag is not used, the DHTML Editing Component will create a Stream for the filtered source.


ITriEditDocument::FilterOut

HRESULT FilterOut(LPSTREAM pSourceStream, LPSTREAM ppOutputStream, 
 DWORD dwFlags, BSTR bstrBaseURL);

Passes an HTML stream through one or more filters to modify the effects of calling the FilterIn method previously.

Errors are returned as constants defined in Triedit.idl. For details about getting this include file, see Requirements.

Error Description
E_OUTOFMEMORY Insufficient memory to maintain both strings.

pSourceStream

[in] A Stream object containing the HTML stream to be filtered. The FilterOut method writes the HTML stream from this parameter to the stream represented by ppOutputStream after applying the filters specified in dwFlags.

ppOutputStream

[out] A Stream object that will be set to the filtered HTML.

dwFlags

[in] Bitfield identifying the type of filtration to be applied to the contents of pSourceStream. For a description of possible flag values, see the next table. Typically, the same dwFlag values would be passed for both FilterIn and FilterOut. For more about possible dwFlag values, see FilterIn.

bstrBaseURL

[in] String specifying the base URL used to resolve relative references to the original HTML source.

A host cannot use ITriEditDocument::FilterOut without having previously called ITriEditDocument::FilterIn for a given document.

The host typically creates a new Stream object using the OLE API CreateStreamOnHGlobal() function. It then copies the document to the new stream using the IPersistStreamInit::Save method. Finally, the host calls the FilterOut method to reconvert changed elements to their original form and save the stream to a file.

The following table lists values that can be used in the dwFlags parameter. Multiple flags are passed by ORing the bitfield. Flag values are defined in Triedit.idl.

dwFlags value Description
dwFilterDefaults All source code filtering options are enabled. This is equivalent to (dwFilterDTCs | dwFilterServerSideScripts | dwPreserveSourceCode).
dwFilterNone No filtering whatsoever. Set this flag if it was set when FilterIn was called.
dwFilterDTCs Removes DTC filtering. Enclosing HTML comments and META tags are restored around DTC Object tags.
dwFilterDTCsWithoutMetaTags Restores design-time controls without the <META> tags around them.
dwFilterServerSideScripts Replaces <% and %> tags around Active Server Page server script.
dwPreserveSourceCode Restores HTML source to its original state.
dwFilterSourceCode Prevents the FilterOut method from adding <HTML> and <BODY> around the filtered text. Use this flag if you passed only a portion of a document in the FilterIn method.
dwFilterMultiByteStream Indicates that the input Stream argument is an ANSI Stream. The Stream object passed to the ITriEditDocument::FilterOut method is assumed to be Unicode by default.
dwFilterUsePstmNew Indicates that the host is passing a valid Stream in the ppOutputStream parameter and that it should be used. If this flag is not used, the DHMTL Editing Component will create a Stream for the filtered source.

Document Object Commands

The following commands are supported by the DHTML Editing Component document object for use with the IOleCommandTarget::Exec Non-MSDN Online link and IOleCommandTarget::QueryStatus methods.

For general information about calling these methods in the DHTML Editing Component, see Sending and Receiving Commands.

Command constants are defined in the Dhtmled.h file, which is part of the set of files included in the Internet Explorer 5 header and library files. For more details, see Requirements.

About the Command ID Syntax

The IOleCommandTarget interface is standard for OLE document objects. In this documentation, the information provided in the topics for individual commands is oriented specifically to the DHTML Editing Component. For example, the command group is always &GUID_TriEditCommandGroup. Because the context is known, the values required for each parameter are indicated with the syntax.

Commands

The following commands are available for the Exec method.

Editing Commands

IDM_TRIED_ACTIVATEACTIVEXCONTROLS, IDM_TRIED_ACTIVATEAPPLETS, IDM_TRIED_ACTIVATEDTCS, IDM_TRIED_BLOCKFMT, IDM_TRIED_BROWSEMODE, IDM_TRIED_COPY, IDM_TRIED_CUT, IDM_TRIED_DELETE, IDM_TRIED_DOVERB, IDM_TRIED_EDITMODE, IDM_TRIED_FIND, IDM_TRIED_GETBLOCKFMTS, IDM_TRIED_HYPERLINK, IDM_TRIED_IMAGE, IDM_TRIED_ORDERLIST, IDM_TRIED_PASTE, IDM_TRIED_PRINT, IDM_TRIED_REDO, IDM_TRIED_REMOVEFORMAT, IDM_TRIED_SELECTALL, IDM_TRIED_SHOWBORDERS, IDM_TRIED_SHOWDETAILS, IDM_TRIED_UNDO, IDM_TRIED_UNLINK, IDM_TRIED_UNORDERLIST

Formatting Commands

IDM_TRIED_BACKCOLOR, IDM_TRIED_BOLD, IDM_TRIED_FONT, IDM_TRIED_FONTNAME, IDM_TRIED_FONTSIZE, IDM_TRIED_FORECOLOR, IDM_TRIED_INDENT, IDM_TRIED_ITALIC, IDM_TRIED_JUSTIFYCENTER, IDM_TRIED_JUSTIFYLEFT, IDM_TRIED_JUSTIFYRIGHT, IDM_TRIED_OUTDENT, IDM_TRIED_UNDERLINE

Absolute Positioning Commands

IDM_TRIED_ABSOLUTE_DROP_MODE, IDM_TRIED_BRING_ABOVE_TEXT, IDM_TRIED_BRING_FORWARD, IDM_TRIED_BRING_TO_FRONT, IDM_TRIED_CONSTRAIN, IDM_TRIED_LOCK_ELEMENT, IDM_TRIED_MAKE_ABSOLUTE, IDM_TRIED_NUDGE_ELEMENT, IDM_TRIED_SEND_BACKWARD, IDM_TRIED_SEND_BELOW_TEXT, IDM_TRIED_SEND_TO_BACK, IDM_TRIED_SET_ALIGNMENT

Note For details about absolute positioning, see Working with Absolutely Positioned Elements.

Table Commands

IDM_TRIED_DELETECELLS, IDM_TRIED_DELETECOLS, IDM_TRIED_DELETEROWS, IDM_TRIED_INSERTCELL, IDM_TRIED_INSERTCOL, IDM_TRIED_INSERTROW, IDM_TRIED_INSERTTABLE, IDM_TRIED_MERGECELLS, IDM_TRIED_SPLITCELL


IDM_TRIED_ABSOLUTE_DROP_MODE

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_ABSOLUTE_DROP_MODE, OLECMDEXECOPT_DODEFAULT, 
 VARIANT* pVarIn, NULL)

Toggles whether elements dropped on the document will be absolutely positioned.

pVarIn

A Boolean expression specifying whether the mode is on or off. TRUE sets drop mode on; FALSE disables drop mode.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

If absolute drop mode is on, all elements that can be absolutely positioned are automatically made absolute when they are dropped onto the document. Only elements coming from outside the document are affected by this mode. Repositioning existing items by dragging them within the document does not convert them to absolutely positioned, even if absolute drop mode is set to True.

Note For details about absolute positioning, see Working with Absolutely Positioned Elements.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_ACTIVATEACTIVEXCONTROLS

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_ACTIVATEACTIVEXCONTROLS, OLECMDEXECOPT_DODEFAULT, 
 VARIANTARG* pVarIn, NULL)

Toggles UI activation for OLE controls.

pVarIn

A Boolean expression specifying whether the mode is on or off. TRUE sets UI activate mode on; FALSE disables UI activate mode.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

When an ActiveX® control is UI activated, clicking it in Edit mode enables its text to be edited directly (rather than being edited by setting properties).

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_ACTIVATEAPPLETS

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_ACTIVATEAPPLETS, OLECMDEXECOPT_DODEFAULT, 
 VARIANTARG* pVarIn, NULL)

Toggles UI activation for Java applets.

pVarIn

A Boolean expression specifying whether the mode is on or off. TRUE sets UI activate mode on; FALSE disables UI activate mode.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

When an applet is UI activated, clicking it in Edit mode enables its text to be edited directly (rather than being edited by setting properties).

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_ACTIVATEDTCS

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_ACTIVATEDTCS, OLECMDEXECOPT_DODEFAULT, 
 VARIANTARG* pVarIn, NULL)

Toggles UI activation for design-time controls (DTCs).

pVarIn

A Boolean expression specifying whether the mode is on or off. TRUE sets UI activate mode on; FALSE disables UI activate mode.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

When a design-time control is UI activated, clicking it in Edit mode enables its text to be edited directly (rather than being edited by setting properties).

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_BACKCOLOR

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_BACKCOLOR, OLECMDEXECOPT_DODEFAULT, VARIANTARG* pVarIn, 
 VARIANTARG* pVarOut)

Applies or returns the background color of the text in the selection.

pVarIn

A numeric RGB color value or color name (for example, "white", "black", and so forth).
pVarOut

Returns the current background color number as a string in a format such as #FFFFFF.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

To set a value, pass a value in pVarIn and NULL in pVarOut. To retrieve a color, pass NULL in pVarIn; the color value is returned in pVarOut.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_BLOCKFMT

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_BLOCKFMT, OLECMDEXECOPT_DODEFAULT, VARIANTARG* pVarIn, 
 VARIANTARG* pVarOut)

Applies or returns the HTML paragraph format of the selection.

pVarIn

A string indicating the style tag to apply, such as "Normal" or "Heading 1". Valid format tags can be derived using IDM_TRIED_GETBLOCKFMT.

pVarOut

Returns the current style tag.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

To set a value, pass a value in pVarIn and NULL in pVarOut. To retrieve the style tag, pass NULL in pVarIn; the style tag is returned in pVarOut.

The IDM_TRIED_BLOCKGMT command is only supported if the selection contains text. If getting the format, the command returns the format information for the paragraph in which the insertion point appears; it is not necessary to select the entire paragraph.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_BOLD

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_BOLD, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Toggles bold character formatting for the selection.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command places <STRONG> and </STRONG> tags around the selection or insertion point. If the selection is already formatted bold, the <STRONG> and </STRONG> tags are removed.

If nothing is selected but the insertion point is within a word, this command treats the current word as the selection.

Tip To allow users to select character formatting attributes for the selection, display the Font dialog box using the IDM_TRIED_FONT command.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_BRING_ABOVE_TEXT

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_BRING_ABOVE_TEXT, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Moves the selected absolutely positioned element in front of the 1-D HTML stream by giving it a positive z-index.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

The 1-D HTML stream contains the elements that are not absolutely positioned. This command makes the element's Z-ORDER style attribute positive, moving it above the 1-D stream.

Note For details about absolute positioning, see Working with Absolutely Positioned Elements.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_BRING_FORWARD

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_BRING_FORWARD, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Moves an absolutely positioned element toward the front of the document or container.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command increments the element's Z-ORDER style attribute by one, readjusting the Z-ORDER style attribute of other elements in the same container as necessary.

Note For details about absolute positioning, see Working with Absolutely Positioned Elements.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_BRING_TO_FRONT

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_BRING_TO_FRONT, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Moves an absolutely positioned element to the front of the document or container by setting its z-index higher than all other elements in its container.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_BROWSEMODE

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_BROWSEMODE, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Puts the current document into Browse mode.

Note When the control is in Browse mode, clicking on a link will launch a new instance of Internet Explorer.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command applies only in Edit mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_CONSTRAIN

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_CONSTRAIN, OLECMDEXECOPT_DODEFAULT, 
 VARIANTARG* pVarIn, NULL)

Sets a mode in which movement in subsequent drag operations is constrained horizontally or vertically.

pVarIn

A Boolean expression specifying whether the mode is on or off. Setting it to TRUE activates the constrain mode; FALSE cancels the mode.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

When this command is executed, it detects the dominant axis the element is being dragged through and constrains the element's movement to that axis.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_COPY

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_COPY, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Copies the selection to the Clipboard.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

Text is placed on the Clipboard in CF_HTML and CF_TEXT format.

This command applies in both Edit mode and Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_CUT

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_CUT, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Copies the object to the Clipboard and then deletes it.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

Text is placed on the Clipboard in CF_HTML and CF_TEXT format.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_DELETE

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_DELETE, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Deletes the selection without placing it on the Clipboard.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

If no element is selected, executing this command deletes the element or character immediately to the right of the insertion point.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_DELETECELLS

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_DELETECELLS, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Deletes the selected table cells.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

The selection or insertion point must be within one or more cells in a table. If nothing is selected, the current cell is the one in which the insertion point appears, and the one that will be deleted. If the selection includes more than one cell, all cells containing any portion of a selection will be deleted--it is not necessary that the entire contents of a cell be selected.

The overall table width is not altered when deleting a cell. Instead, the cell widths are adjusted to accommodate the deleted cell.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_DELETECOLS

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_DELETECOLS, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Deletes the selected table columns.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command is only enabled if the selection is within a table. The command works by deleting the corresponding <TD> element from every row of the table. For example, if the selection is in the third <TD> element, the command deletes the third <TD> element from every row of the table.

The selection or insertion point must be within one or more columns in a table. If nothing is selected, the current column is the one in which the insertion point appears, and the one that will be deleted. If the selection includes more than one column, all columns containing any portion of a selection will be deleted--it is not necessary that the entire contents of a column be selected.

The overall table width is not altered when deleting a column. Instead, the column widths are adjusted to accommodate the deleted column.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_DELETEROWS

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_DELETEROWS, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Deletes the selected table rows.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

The selection or insertion point must be within one or more cells in a table, but within a single row. If nothing is selected, the current row is the one in which the insertion point appears. If the selection includes more than one row, all rows containing any portion of a selection will be deleted--it is not necessary that the entire contents of a row be selected.

When the row is deleted, the overall table height is reduced by the height of the deleted row.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_DOVERB

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_DOVERB, OLECMDEXECOPT_DODEFAULT, pVarIn, NULL)

Executes a verb associated with an ActiveX control on a page.

pVarIn

A VARIANT of type VT_I4 indicating the verb to be executed.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command is only enabled when there is an ActiveX control selected on that page.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_EDITMODE

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_EDITMODE, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Puts the current document into Edit mode.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command applies only in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_FIND

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_FIND, OLECMDEXECOPT_PROMPTUSER, NULL, NULL)

Displays the Find dialog box to allow users to specify text to search for in the current document.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

The command searches the DHTML text of the entire current document, even if some text is selected. It ignores textual elements of controls, such as captions, labels, or parameter values.

This command applies only in Edit mode. It has no effect in Browse mode.


IDM_TRIED_FONT

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_FONT, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Displays the Font dialog box and applies the user's choices to the selection.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

Executing this command adds a <FONT> element around the selection if one is not already there. Within the <FONT> element, the command sets the COLOR, FACE, and SIZE attributes with information taken from the dialog box. The command will also add <STRONG>, <EM>, or <U> tags around the selection as appropriate.

Note Although the Font dialog box displays font sizes in points, the command translates these into HTML font sizes (in the range 1 to 7).

If nothing is selected but the insertion point is within a word, this command treats the current word as the selection.

To get or set font attributes without displaying a dialog box, use the following commands:

This command applies only in Edit mode. It has no effect in Browse mode.

IDM_TRIED_FONTNAME

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup,
 IDM_TRIED_FONTNAME, OLECMDEXECOPT_DODEFAULT, 
 VARIANTARG* pVarIn, VARIANTARG* pVarOut)

Applies or returns the font name of the selection.

pVarIn

A string representing the name of the font face.

pVarOut

Returns the current font face name as a VT_BSTR value.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

To set a value, pass a value in pVarIn and NULL in pVarOut. To retrieve the font face name, pass NULL in pVarIn; the name is returned in pVarOut.

This command is only supported if the selection contains text.

When setting the font, if nothing is selected but the insertion point is within a word, this command treats the current word as the selection.

Tip To allow the user to choose a font face, display the Font dialog box using the IDM_TRIED_FONT command.

When getting the font, the command returns the font face for the selection as established by a <FONT> element or by the FONT-FAMILY style attribute. If the text has not been formatted with a specific font face, the command returns the default font face name for the selected element.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_FONTSIZE

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_FONTSIZE, OLECMDEXECOPT_DODEFAULT, 
 VARIANTARG* pVarIn, VARIANTARG* pVarOut)

Applies or returns the font size of the selection.

pVarIn

A numeric value in the range 0 to 7 specifying the HTML font size value.

pVarOut

Returns the current font size.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

To set a value, pass a value in pVarIn and NULL in pVarOut. To retrieve the size, pass NULL in pVarIn; the size is returned in pVarOut.

This command is only supported if the selection contains text.

When setting the font size, this command adds a <FONT> element around the selection if one is not already there. Within the <FONT> element, this command adds or changes the SIZE attribute. If nothing is selected but the insertion point is within a word, this command treats the current word as the selection.

Tip To allow the user to choose a font size, display the Font dialog box using the IDM_TRIED_FONT command.

When getting the font size, this command returns the font size for the selection as established by the SIZE attribute of the <FONT> element. (It does not return an absolute point size.) If the text has not been formatted with a specific HTML font size, the command returns the default font size for the selected element.

Note Font sizes are set relative the base font.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_FORECOLOR

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_FORECOLOR, OLECMDEXECOPT_DODEFAULT, 
 VARIANTARG* pVarIn, VARIANTARG* pVarOut)

Applies or returns the foreground color of the text in the selection.

pVarIn

A numeric RGB color value or color name (for example, "white", "black", and so forth).

pVarOut

Returns the current foreground color number.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

To set a value, pass a value in pVarIn and NULL in pVarOut. To retrieve a color, pass NULL in pVarIn; the color value is returned in pVarOut.

When setting the forecolor, this command adds a <FONT> element around the selection if one is not already there. Within the <FONT> element, this command adds or changes the COLOR attribute plus the number or name of the color.

When getting the forecolor, this command returns the value of the COLOR attribute in the <FONT> element that applies to the selection. If no <FONT> element applies, the command returns the default color for the selection.

Tip To allow the user to choose a font color, display the Font dialog box using the IDM_TRIED_FONT command.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_GETBLOCKFMTS

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_GETBLOCKFMTS, OLECMDEXECOPT_DODEFAULT, NULL
 VARIANTARG* pVarOut)

Returns a list of valid format strings to be used as arguments to IDM_TRIED_BLOCKFMT.

pVarOut

Returns a SafeArray of strings including block formats such as "Normal", "Heading1", and so forth.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command is only supported if the selection contains text. The command returns the format information for the paragraph in which the insertion point appears; it is not necessary to select the entire paragraph.

This command applies both in Edit mode and Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_HYPERLINK

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_HYPERLINK, OLECMDEXECOPT cmdExecOpt, 
 VARIANTARG* pVarIn, VARIANTARG* pVarOut)

Creates a link by inserting <A> and </A> tags around the selection or at the insertion point.

cmdExecOpt

Determines if the command will display a user interface. Possible values are:

pVarIn

The URL of the hyperlink to set.

pVarOut

If OLECMDEXECOPT_PROMPTUSER is passed in the cmdExecOpt parameter, returns the URL selected by the user in the Hyperlink dialog box.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

To set a value, pass a URL in pVarIn and NULL in pVarOut. To retrieve the URL, pass NULL in pVarIn; the URL is returned in pVarOut.

If text or an image is selected, the command converts it into a link. If the selection is within an existing <A> tag when this command is executed, the Hyperlink dialog box is displayed to allow the user to modify the HREF attribute.

If no text is selected, the command inserts an <A> element at the current insertion point, which is useful for creating bookmarks. For bookmarks, the protocol selected in the Hyperlink dialog box should be "(other)".

This command applies only in Edit mode. It has no effect in Browse mode.

See Also Document Object Commands


IDM_TRIED_IMAGE

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_IMAGE, OLECMDEXECOPT cmdExecOpt, 
 VARIANTARG* pVarIn, VARIANTARG* pVarOut)

Inserts a graphic by placing an <IMG> tag at the insertion point.

cmdExecOpt

Determines if the command will display a user interface. Possible values are:

pVarIn

A string containing the name of the .gif or other graphics file to be used as the HREF attribute of the <A> tag.

pVarOut

If OLECMDEXECOPT_PROMPTUSER is passed in the cmdExecOpt parameter, returns the URL selected by the user in the Image dialog box.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

To set a value, pass a URL in pVarIn and NULL in pVarOut. To retrieve the URL, pass NULL in pVarIn; the URL is returned in pVarOut.

If text is selected, the <IMG> tag replaces the text.

The Picture dialog box prompts the user for the name of the graphics file and for attributes such as alternate text, borders, alignment, and spacing. If you pass OLECMDEXECOPT_DONTPROMPTUSER for the second parameter, you cannot specify any attributes except the URL of the image file.

This command applies only in Edit mode. It has no effect in Browse mode.

See Also Document Object Commands


IDM_TRIED_INDENT

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_INDENT, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Indents the selected paragraph.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command affects the entire container containing the insertion point or selection, such as a <P> or <DIV> element. This command adds a <BLOCKQUOTE> element around the container for the selection. The command affects the entire container in which the insertion point or selection occurs, even if a subset of the text is selected.

To reverse the effect of indenting a paragraph, execute the IDM_TRIED_OUTDENT command.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_INSERTCELL

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_INSERTCELL, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Inserts a cell in front of the selected cell in a table.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command is only enabled if the selection is within a table.

The selection or insertion point must be within a cell in a table. If nothing is selected, the current cell is the one in which the insertion point appears. If the selection spans more than one cell, the current cell is defined as the one that is leftmost and topmost in the selection.

The overall table width is not altered when inserting a cell. Instead, the cell widths are adjusted to accommodate the new cell. When the new cell is inserted, individual cell attributes are copied from the current cell to the new one.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_INSERTCOL

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_INSERTCOL, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Inserts a column in front of the selected column in a table.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command is only enabled if the selection is within a table.

The selection or insertion point must be within a column in a table. If nothing is selected, the current column is the one in which the insertion point appears. A new column is inserted to the left of the selected column.

The overall table width is not altered when inserting a column. Instead, the cell widths are adjusted to accommodate the new column.

The new column will contain the same number of cells as the current column. The individual cell attributes are copied cell for cell from the current column to the new one.

This command applies only in Edit mode. It has no effect in Browse mode.

See Also Document Object Commands


IDM_TRIED_INSERTROW

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup,
 IDM_TRIED_INSERTROW, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Inserts a row in front of the selected row in a table.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command is only enabled if the selection is within a table.

The selection or insertion point must be within a row in a table. If nothing is selected, the current row is the one in which the insertion point appears.

The new row will contain the same number of cells as the previous row, with the same COLSPAN attributes, cell attributes, and styles.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_INSERTTABLE

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_INSERTTABLE, OLECMDEXECOPT_DODEFAULT, 
 VARIANTARG* pVarIn, NULL)

Inserts a table into the document.

pVarIn

A SafeArray of 5 VARIANT-type elements containing the following values:

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

Inserts a <TABLE> tag at the selection with caption, dimension, and other attributes taken from pVarIn. You can supply from one to five parameters for this command; default values are provided for values that you do not supply.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_ITALIC

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_ITALIC, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Toggles italic character formatting for the selection.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

When passed with the Exec method, this command places <EM> and </EM> tags around the selection or at the insertion point. If the selection is already formatted italic, the <EM> and </EM> tags are removed. If nothing is selected but the insertion point is within a word, this command treats the current word as the selection.

Tip To allow users to select character formatting attributes for the selection, display the Font dialog box using the IDM_TRIED_FONT command.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_JUSTIFYCENTER

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_JUSTIFYCENTER, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Centers the text in the selected paragraph.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command adds an ALIGN attribute to the container (<P> or <DIV>) for the current text. If the text is not already in a container, the command adds <P> and </P> tags around the text. It cannot be applied to text in a container that does not support the ALIGN attribute, such as text in an HTML control or to an ActiveX control. In a table cell, the command adds a <DIV> element to create a container.

Note Justification can be applied to cells within a table, but not to a table as a whole.

The command affects the entire container in which the insertion point or selection occurs, even if a subset of the text is selected.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_JUSTIFYLEFT

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_JUSTIFYLEFT, OLECMDEXECOPT_DODEFAULT,  NULL, NULL)

Left-justifies the text in the selected paragraph.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command removes the ALIGN attribute inserted earlier with a IDM_TRIED_JUSTIFYRIGHT or IDM_TRIED_JUSTIFYCENTER command. It affects the entire container in which the insertion point or selection occurs, even if a subset of the text is selected.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_JUSTIFYRIGHT

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_JUSTIFYRIGHT, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Right-justifies the text in the selected paragraph.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command adds an ALIGN attribute to the container (<P> or <DIV>) for the current text. If the text is not already in a container, the command adds <P> and </P> tags around the text. It cannot be applied to text in a container that does not support the ALIGN attribute, such as text in an HTML control or to an ActiveX control. In a table cell, the command adds a <DIV> element to create a container.

Note Justification can be applied to cells within a table, but not to a table as a whole.

The command affects the entire container in which the insertion point or selection occurs, even if a subset of the text is selected.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_LOCK_ELEMENT

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_LOCK_ELEMENT, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Toggles the lock state of an absolutely positioned element, which prevents the element from being moved or resized at design time.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

The locked state of an element is persisted into the HTML stream by adding a DESGN_TIME_LOCK attribute to the element. Locked elements cannot be moved with the IDM_TRIED_NUDGE_ELEMENT command.

Note For details about absolute positioning, see Working with Absolutely Positioned Elements.

Locking does not apply when the HTML is viewed in Browse mode. This command applies only in Edit mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_MAKE_ABSOLUTE

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_MAKE_ABSOLUTE, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Toggles an element between static positioning and absolute positioning.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command is supported only for elements that can support a setting of "absolute" for the POSITION style attribute. In general, this includes containers such as <DIV>, <SPAN>, <MARQUEE>, and <TABLE> elements as well as images, HTML controls (buttons, text areas), objects, applets, and horizontal rules. Text outside of container elements cannot be positioned absolutely. Design-time controls (DTCs) cannot be positioned absolutely.

This command adds a STYLE attribute to the selected element and sets the following style attributes: POSITION (which is set to "absolute"); TOP; and Z-INDEX. If the selection is already part of an ordered list, POSITION and Z-INDEX attributes are removed.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_MERGECELLS

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_MERGECELLS, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Merges the selected table cells.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

The selection must include two or more table cells. All cells containing any portion of a selection will be merged--it is not necessary that the entire contents of a cell be selected.

When cells are merged, their contents are concatenated together in the remaining cell. The merged cells assume the attributes of the cell that was leftmost and topmost in the selection. The overall table width is not altered when cells are merged. Instead, the cell widths are adjusted.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_NUDGE_ELEMENT

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_NUDGE_ELEMENT, OLECMDEXECOPT_DODEFAULT, 
 VARIANTARG* pVarIn, NULL)

Repositions the selected element using pixel coordinates relative to the element's current position.

pVarIn

A VARIANT LPPOINT value with its x,y members set to the number of pixels to move the element.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.

See Also Document Object Commands


IDM_TRIED_ORDERLIST

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_ORDERLIST, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Turns the selection into a numbered (ordered) list or removes individual elements from the list.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command acts on the selection, or if nothing is selected, on the current paragraph only. The command surrounds the affected paragraphs with <OL> and </OL> tags, and places <LI> and </LI> around individual paragraphs. If the selection is already part of an ordered list, the tags are removed and surrounding text is fixed up appropriately.

This command applies only in Edit mode. It has no effect in Browse mode.


IDM_TRIED_OUTDENT

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_OUTDENT, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Decreases the indentation of the selected paragraph.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

Indentation is established by <BLOCKQUOTE> elements. This command removes <BLOCKQUOTE> elements surrounding the selected text. The command affects the entire container in which the insertion point or selection occurs, even if a subset of the text is selected.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_PASTE

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_PASTE, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Pastes the contents of the Clipboard at the insertion point or over the selection.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

HTML text can be on the Clipboard in two forms. One form (CF_HTML) includes all HTML formatting instructions. The other (CF_TEXT) contains only the plain text, with all HTML tags removed. When you paste from the Clipboard into the DHTML Editing control, the control attempts to paste the version of the text that includes HTML formatting.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_PRINT

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_PRINT, OLECMDEXECOPT cmdExecOpt, NULL, NULL)

Prints the current document.

cmdExecOpt

This parameter determines if the command will display a user interface. Possible values are:

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command applies both in Edit mode and Browse mode.

See Also Document Object Commands


IDM_TRIED_REDO

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_REDO, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Re-executes the command most recently reversed with the IDM_TRIED_UNDO command.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command can be executed as many times as there are commands to be undone. Commands can only be re-executed in the order they were undone--you cannot selectively redo a specific command. After a command has been redone, it is removed from the list of commands (the redo buffer) that can be redone.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_REMOVEFORMAT

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_REMOVEFORMAT, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Removes all formatting tags from the selection.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_SELECTALL

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_SELECTALL, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Selects everything in the body of the document.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_SEND_BACKWARD

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_SEND_BACKWARD, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Moves an absolutely positioned element one z-order layer toward the back of the document or container, adjusting the z-order of other elements in the same container.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.

See Also Working with Absolutely Positioned Elements


IDM_TRIED_SEND_BELOW_TEXT

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_SEND_BELOW_TEXT, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Moves an absolutely positioned element behind the 1-D HTML stream by giving it a negative z-index.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command assigns a negative value to the element's Z-ORDER style attribute, readjusting the Z-ORDER style attribute of other elements as necessary. Because the 1-D HTML stream is considered to have a z-order value of 0, giving an element a negative z-order value places it behind the 1-D stream.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.

See Also Working with Absolutely Positioned Elements


IDM_TRIED_SEND_TO_BACK

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_SEND_TO_BACK, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Moves an absolutely positioned element to the back of the document or container by setting its z-index lower than all other elements in its container.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

The z-index of a new object on a page is initially set to be higher than all other objects in its container, and therefore on top of previous items in the container.

This command sets the element's Z-ORDER style attribute to the lowest of all the absolutely positioned elements on its side of the 1-D stream. (Elements with a positive Z-ORDER style attribute value are in front of the 1-D stream; elements with a negative Z-ORDER style attribute value are behind it.) The command adjusts the Z-ORDER style attribute of other elements as necessary. If the element is already at the back, executing this command makes no change.

Note For details about absolute positioning, see Working with Absolutely Positioned Elements.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_SET_ALIGNMENT

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_SET_ALIGNMENT, OLECMDEXECOPT_DODEFAULT, 
 VARIANTARG* pVarIn, NULL)

Toggles the invisible snap-to positioning grid on and off and sets the cell size.

pVarIn

A VARIANT LPPOINT value, with the x member set to the grid's width and the y member set to the grid's height.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

To turn the grid off, pass 0,0 in pVarIn. Any positive value passed in this parameter turns on the grid and sets the grid spacing at the same time.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_SHOWBORDERS

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_SHOWBORDERS, OLECMDEXECOPT_DODEFAULT, 
 VARIABLEARG* pVarIn, NULL)

Displays a 1-pixel border around all <DIV> elements and tables in Edit mode.

pVarIn

A Boolean expression specifying whether borders are enabled. TRUE enables borders; FALSE disables them.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

To make it easier to work with tables and with absolutely positioned <DIV> elements, the control can display a 1-pixel border around those controls in Edit mode if they do not already have a border. The border controlled by this command is not displayed in Browse mode.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_SHOWDETAILS

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_SHOWDETAILS, OLECMDEXECOPT_DODEFAULT, 
 VARIANTARG* pVarIn, NULL)

Shows hidden tags, anchors, and other elements as glyphs in Edit mode.

pVarIn

A Boolean expression specifying whether the display of glyphs is enabled. TRUE enables it; FALSE disables it.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

The glyphs controlled by this command are not displayed in Browse mode. This command applies only in Edit mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.

See Also Displaying Glyphs for Non-Visual Elements


IDM_TRIED_SPLITCELL

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_SPLITCELL, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Splits the selected table cell.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

The selection or insertion point must be within one or more cells in a table. If nothing is selected, the current cell is the one in which the insertion point appears, and the one that is split. If the selection includes more than one cell, all cells containing any portion of a selection will be split--it is not necessary that the entire contents of a cell be selected.

Each selected cell is split horizontally--an empty cell is added to the right of the selected cell. The overall table width is not altered when splitting a cell. Instead, the cell widths are adjusted to accommodate the deleted cell.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_UNDERLINE

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_UNDERLINE, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Toggles underlining for the selection.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command places <U> and </U> tags around the selection or insertion point. If the selection is already underlined, the <U> and </U> tags are removed.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_UNDO

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_UNDO, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Reverses the effect of the last editing operation.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

You can undo an unlimited number of previously made edits, but they are undone in the reverse order --you cannot selectively undo specific commands. Undone commands can be redone with the IDM_TRIED_REDO command.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_UNLINK

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_UNLINK, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Removes <A> and </A> tags from around the selection.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

The command affects the entire container in which the insertion point or selection occurs, even if a subset of the text is selected.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.


IDM_TRIED_UNORDERLIST

HRESULT pOleCommandTarget::Exec(&GUID_TriEditCommandGroup, 
 IDM_TRIED_UNORDERLIST, OLECMDEXECOPT_DODEFAULT, NULL, NULL)

Turns the selection into a bulleted (unordered) list, or toggles individual bullets on and off.

To test whether this command is appropriate in the current context, call the QueryStatus method. To execute the command, call the Exec method. For general information about calling these methods, see Sending and Receiving Commands.

This command acts on the selection, or if nothing is selected, on the current paragraph only. The command surrounds the affected paragraphs with <UL> and </UL> tags, and places <LI> and </LI> around individual paragraphs. If the selection is already part of an ordered list, the tags are removed and surrounding text is fixed up appropriately.

This command applies only in Edit mode. It has no effect in Browse mode.

This command does not support a user interface, so when calling the Exec method, you should always pass the constant OLECMDEXECOPT_DODEFAULT as the second parameter. For more details, see Document Object Commands.



Back to topBack to top

Did you find this material useful? Gripes? Compliments? Suggestions for other articles? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.