One of the following values is returned when you use this command ID with the QueryStatus method:
Setting Description
DECMDF_DISABLED (1) The selection is an element (such as a control or table) that does not support bold formatting. If you call the ExecCommand method in this state, an error occurs.
DECMDF_ENABLED (3) The selection is not bold, or includes both bold and non-bold elements.
DECMDF_LATCHED (7) The selection is already bold.
Remarks
Use the QueryStatus method to determine whether the selection or insertion point location can accept this command.
If nothing is selected but the insertion point is within a word, this command treats the current word as the selection.
When passed with the ExecCommand method, this command places and tags around the selection or at the insertion point. If the selection is already formatted bold, the and tags are removed. If the selection is within a larger string of bold text, the command inserts </STRONG> and tags around the selection, effectively turning bold off for the selection.
Tip To allow users to select character formatting attributes for the selection, display the Font dialog box using the DECMD_FONT command.
Back to top
--------------------------------------------------------------------------------
DECMD_BRING_ABOVE_TEXT
Description
Moves an absolutely positioned element in front of the 1-D HTML stream by giving it a positive z-index.
Syntax
retVal = object. QueryStatus( DECMD_BRING_ABOVE_TEXT )
object. ExecCommand DECMD_BRING_ABOVE_TEXT
Part Description
object The DHTML Editing control
Return Value
One of the following values is returned when you use this command ID by the QueryStatus method:
Setting Description
DECMDF_DISABLED (1) The element is not absolutely positioned. If you call the ExecCommand method in this state, an error occurs.
DECMDF_ENABLED (3) The selected element can be repositioned.
Remarks
This command is supported for absolutely positioned elements (those that have been positioned using DECMD_MAKE_ABSOLUTE). Use the QueryStatus method to determine whether the selected element can be moved in z-order.
When passed with the ExecCommand method, 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.
Back to top
--------------------------------------------------------------------------------
DECMD_BRING_FORWARD
Description
Moves an absolutely positioned element one z-order layer toward the front of the document or container, adjusting the z-order of other elements in the same container.
Syntax
retVal = object. QueryStatus( DECMD_BRING_FORWARD )
object. ExecCommand DECMD_BRING_FORWARD
Part Description
object The DHTML Editing control
Return values
One of the following values is returned when you use this command ID with the QueryStatus method:
Setting Description
DECMDF_DISABLED (1) The element is not absolutely positioned. If you call the ExecCommand method in this state, an error occurs.
DECMDF_ENABLED (3) The selected element can be repositioned.
Remarks
This command is supported for absolutely positioned elements (those that have been positioned using DECMD_MAKE_ABSOLUTE). Use the QueryStatus method to determine whether the selected element can be moved in z-order.
When passed with the ExecCommand method, 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.
Back to top
--------------------------------------------------------------------------------
DECMD_BRING_TO_FRONT
Description
Moves an absolutely positioned element to the front of the document or container.
Syntax
retVal = object. QueryStatus( DECMD_BRING_TO_FRONT )
object. ExecCommand DECMD_BRING_TO_FRONT
Part Description
object The DHTML Editing control
Return values
One of the following values is returned when you use this command ID with the QueryStatus method:
Setting Description
DECMDF_DISABLED (1) The element is not absolutely positioned. If you call the ExecCommand method in this state, an error occurs.
DECMDF_ENABLED (3) The selected element can be repositioned.
Remarks
This command is supported for absolutely positioned elements (those that have been positioned using DECMD_MAKE_ABSOLUTE). Use the QueryStatus method to determine whether the selected element can be moved in z-order.
When passed with the ExecCommand method, this command sets the element's Z-ORDER style attribute to the highest of all the absolutely positioned elements on the page or in its container, readjusting the Z-ORDER style attribute of other elements as necessary.
Note For details about absolute positioning, see Working with Absolutely Positioned Elements.
Back to top
--------------------------------------------------------------------------------
DECMD_COPY
Description
Copies the selection to the Windows Clipboard.
Syntax
retVal = object. QueryStatus( DECMD_COPY )
object. ExecCommand DECMD_COPY
Part Description
object The DHTML Editing control
Return values
One of the following values is returned when you use this command ID with the QueryStatus method:
Setting Description
DECMDF_DISABLED (1) There is no selection or the selection consists of text in a password control. If you call the ExecCommand method in this state, an error occurs.
DECMDF_ENABLED (3) The selection can be copied.
Remarks
When passed with the ExecCommand method, this command places two forms of the selected text on the Windows Clipboard. One form (CF_HTML) includes all HTML formatting instructions. The other (CF_TEXT) contains only the plain text, with all HTML tags removed.
Back to top
--------------------------------------------------------------------------------
DECMD_CUT
Description
Copies the selection to the Windows Clipboard, then deletes it from the document.
Syntax
retVal = object. QueryStatus( DECMD_CUT )
object. ExecCommand DECMD_CUT
Part Description
object The DHTML Editing control
Return values
One of the following values is returned when you use this command ID with the QueryStatus method:
Settingt Description
DECMDF_DISABLED (1) There is no selection or the selection consists of text in a password control.
DECMDF_ENABLED (3) The selection can be cut.
Remarks
When passed with the ExecCommand method, this command places two forms of the selected text on the Windows Clipboard. One form (CF_HTML) includes all HTML formatting instructions. The other (CF_TEXT) contains only the plain text, with all HTML tags removed.
Back to top
--------------------------------------------------------------------------------
DECMD_DELETE
Description
Deletes the selection without placing it on the Windows Clipboard.
Syntax
retVal = object. QueryStatus( DECMD_DELETE )
object. ExecCommand DECMD_DELETE
Part Description
object The DHTML Editing control
Return value
When you use this command ID with the QueryStatus method, it always returns DECMDF_ENABLED (3).
Remarks
If no element is selected, passing this command with the ExecCommand method deletes the element or character immediately to the right of the insertion point.
Back to top
--------------------------------------------------------------------------------
DECMD_DELETECELLS
Description
Deletes the selected cells from a table.
Syntax
retVal = object. QueryStatus( DECMD_DELETECELLS )
object.ExecCommand DECMD_DELETECELLS
Part Description
object The DHTML Editing control
Return values
One of the following values is returned when you use this command ID with the QueryStatus method:
Setting Description
DECMDF_DISABLED (1) The selection or insertion point is not inside a table, or the selection includes elements in more than one row. This value is also returned if the insertion point is within the table caption or if the entire table is selected. If you call the ExecCommand method in this state, an error occurs.
DECMDF_ENABLED (3) The selection or insertion point is within cells in a table.
Remarks
Use the QueryStatus method to determine whether the selection or insertion point location can accept this command. Use the ExecCommand method to remove a cell.
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.
Back to top
--------------------------------------------------------------------------------
DECMD_DELETECOLS
Description
Deletes all the columns in a table containing selected text.
Syntax
retVal = object. QueryStatus( DECMD_DELETECOLS )
object.ExecCommand DECMD_DELETECOLS
Part Description
object The DHTML Editing control
Return values
One of the following values is returned when you use this command ID with the QueryStatus method:
Part Description
DECMDF_DISABLED (1) The selection or insertion point is not inside a table. This value is also returned if the insertion point is within the table caption, if the entire table is selected, or if the selection spans more than one row. If you call the ExecCommand method in this state, an error occurs.
DECMDF_ENABLED (3) The selection or insertion point is within a column in a table.
Remarks
Use the QueryStatus method to determine whether the selection or insertion point location can accept this command. Use the ExecCommand method to remove a column.
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.
Back to top
--------------------------------------------------------------------------------
DECMD_DELETEROWS
Description
Deletes all rows containing selected elements.
Syntax
retVal = object. QueryStatus( DECMD_DELETEROWS )
object.ExecCommand DECMD_DELETEROWS
Part Description
object The DHTML Editing control
Return values
One of the following values is returned when you use this command ID with the QueryStatus method:
Setting Description
DECMDF_DISABLED (1) The selection or insertion point is not inside a table. This value is returned if the insertion point is within the table caption or if the entire table is selected. If you call the ExecCommand method in this state, an error occurs.
DECMDF_ENABLED (3) The selection or insertion point is within a row in a table.
Remarks
Use the QueryStatus method to determine whether the selection or insertion point location can accept this command. Use the ExecCommand method to remove a row.
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.
Back to top
--------------------------------------------------------------------------------
DECMD_FINDTEXT
Description
Displays the Find dialog box to allow users to specify text to search for in the current document.
Syntax
retVal = object. QueryStatus( DECMD_FINDTEXT )
object.ExecCommand DECMD_FINDTEXT
Part Description
object The DHTML Editing control
Return values
One of the following values is returned when you use this command ID with the QueryStatus method:
Setting Description
DECMDF_DISABLED (1) The selection or insertion point is in a control or other element that does not support searching. This value is also returned if the current document is an HTML dialog box.
DECMDF_ENABLED (3) The Find dialog box can be displayed.
Remarks
Use the QueryStatus method to determine whether the selection or insertion point location can accept this command.
When passed with the ExecCommand method, this command always displays the Find dialog; there is no option not to display a user interface. 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.
Back to top
--------------------------------------------------------------------------------
DECMD_FONT
Description
Displays the Font dialog box and applies the user's choices to the selection.
Syntax
retVal = object. QueryStatus( DECMD_FONT )
object.ExecCommand DECMD_FONT
Part Description
object The DHTML Editing control
Return values
One of the following values is returned when you use this command ID with the QueryStatus method:
Setting Description
DECMDF_DISABLED (1) The selection includes an element, such as a table, that does not support the element. If you call the ExecCommand method in this state, an error occurs.
DECMDF_ENABLED (3) The selection supports the element.
Remarks
Use the QueryStatus method to determine whether the selection or insertion point location can accept this command.
When passed with the ExecCommand method, this command always displays the Font dialog; there is no option not to display a user interface. Executing this command adds a element around the selection if one is not already there. Within the element, the command sets the COLOR, FACE, and SIZE attributes with information taken from the dialog box. The command will also add , , or 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 set font attributes without displaying a dialog box, use the following commands:
DECMD_BOLD
DECMD_ITALIC
DECMD_SETFONTNAME
DECMD_SETFONTSIZE
DECMD_SETFORECOLOR
DECMD_UNDERLINE
To get the current font attributes for the selection, execute the following commands:
DECMD_GETFONTNAME
DECMD_GETFONTSIZE
DECMD_GETFORECOLOR
Back to top
--------------------------------------------------------------------------------
DECMD_GETBACKCOLOR
Description
Gets the background color of the text in the selection.
Syntax
retVal = object. QueryStatus( DECMD_GETBACKCOLOR )
retVal = object. ExecCommand DECMD_GETBACKCOLOR
Part Description
object The DHTML Editing control
Return values
One of the following values is returned when you use this command ID with the QueryStatus method:
Stting Description
DECMDF_DISABLED (1) The selection is an element that does not support a BACKCOLOR attribute. If you call the ExecCommand method in this state, an error occurs.
DECMDF_ENABLED (3) The selection contains text.
DECMDF_NINCHED (11) There is no selection, or the selection does not have a BACKCOLOR attribute set.
When you use this command ID with the ExecCommand method, the return value is a background color. This string is an RGB color value such as #FF0000 for red.
If the selection includes a mixture of text with a BACKCOLOR attribute and any other type of element -- for example, a control or text without a BACKCOLOR attribute -- the method returns the empty string ("") as the return value.
Remarks
Use the QueryStatus method to determine whether the selection or insertion point location can accept this command. Use the ExecCommand method to return the current background color.
Back to top
--------------------------------------------------------------------------------
DECMD_GETBLOCKFMT
Description
Returns the HTML paragraph format of the selection.
Syntax
retVal = object. QueryStatus( DECMD_GETBLOCKFMT )
retVal = object. ExecCommand DECMD_GETBLOCKFMT
Part Description
object The DHTML Editing control
Return values
One of the following values is returned when you use this command ID with the QueryStatus method:
Setting Description
DECMDF_DISABLED (1) The selection includes an element, such as a table or control, that does not support HTML formats. If you call the ExecCommand method in this state, an error occurs.
DECMDF_ENABLED (3) The selection supports formats.
When you use this command ID with the ExecCommand method, the return value is a string containing the name of an HTML paragraph format, such as "Normal" or "Heading 1". If the text has not been formatted with a block format, the command returns "Normal" If the command cannot return a single format (for example, if the selection contains text from paragraphs with different formats), the command returns the empty string ("").
Remarks
Use the QueryStatus method to determine whether the selection or insertion point location can accept this command. Use the ExecCommand method to return the current format.
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.
Note To get a list of valid HTML paragraph format names, execute the DECMD_GETBLOCKFMTNAMES command.
Back to top
--------------------------------------------------------------------------------
DECMD_GETBLOCKFMTNAMES
Description
Gets a list of valid paragraph format names for use with the DECMD_SETBLOCKFMT command.
Syntax
retVal = object. QueryStatus( DECMD_GETBLOCKFMTNAMES)
object. ExecCommand DECMD_GETBLOCKFMTNAMES, OLECMDEXECOPT_DODEFAULT, blockFmtParam
Part Description
object The DHTML Editing control
OLECMDEXECOPT_DODEFAULT A constant value specifying that the command should perform its default user interface behavior (in this case, do not display a dialog box.) This parameter is passed primarily as a placeholder so the blockFmtParam parameter is interpreted correctly.
blockFmtParam A DEGetBlockFmtNamesParam object created before this command is executed. The command loads the object's Names property with an array of strings containing the list of currently supported, localized paragraph format names.
This parameter is not optional; you must pass an object of this type to the DECMD_GETBLOCKFMTNAMES command. For more information, see "Remarks" below.
Return value
QueryStatus always returns DECMDF_DISABLED (1) for this command. However, this command is valid at any time.
Remarks
Use the QueryStatus method to determine whether the selection or insertion point location can accept this command. Use the ExecCommand method to return a list of formats.
The blockFmtParam parameter requires an object that must be created before being passed to the DECMD_GETBLOCKFMTNAMES command. The object's progID is:
DEGetBlockFmtNamesParam.DEGetBlockFmtNamesParam
Its classID is:
8d91090e-b955-11d1-adc5-006008a5848c
For example, the following Visual Basic® code creates a DEGetBlockFmtNamesParam object, passes it to a DECMD_GETBLOCKFMTNAMES command, and populates a combo box called cmbBlockFmt with the results returned by the command in the object.
' The following appears in the Declarations. Optional, but provides
' statement completion for the object.
Dim f as DEGetBlockFmtNamesParam
' [...]
Private Sub DisplayFormats()
If cmbBlockFmt.ListCount < 1 Then
Set
f=CreateObject("DEGetBlockFmtNamesParam.DEGetBlockFmtNamesParam
")
DEdit1.ExecCommand(DECMD_GETBLOCKFMTNAMES, _
OLECMDEXECOPT_DODEFAULT,f)
For Each fmtName in f.Names
cmbBlockFmt.AddItem(fmtName)
Next
End If
End Sub
If you are working in a scripting language, you can create a DEGetBlockFmtNamesParam object in code using the CreateObject function. Alternatively, you can use an