# action Attribute

Specifies an action of an editing component, using the syntax "NameOfEditingComponent::NameOfAction".

## Type

    xsd:NMTOKEN

## Remarks

The action attribute is an optional attribute of the button element, but is required for buttons used with editing components.

The following are the editing actions that may be used as the value of the action attribute.

Name | Description
--- | ---
xCollection::insert | Inserts an item.
xCollection::insertBefore | Inserts an item before the current selection.
xCollection::insertAfter | Inserts an item after the current selection.
xCollection::remove | Removes an item.
xCollection::removeAll | Removes all items.
xOptional::insert | Inserts an optional item.
xOptional::remove | Removes an optional item.
xReplace::replace | Replaces an existing item.
xFileAttachment::attach | Opens a dialog box to browse for files to attach to a form.
xFileAttachment::open | Opens a file attached to a form.
xFileAttachment::saveAs | Opens the a dialog box to browse for a location where a file is to be saved.
xFileAttachment::remove | Removes the file from the form.

## Example

The following is an example of the action attribute as it is used in the button element:

    <xsf:menuArea name="msoInsertMenu">
       <xsf:menu caption="&amp;Section">
          <xsf:button action="xCollection::insert" xmlToEdit="CD_10"
             caption="CD" showIf="always"></xsf:button>
          <xsf:button action="xCollection::insert" xmlToEdit="Track_14"
             caption="Track" showIf="always"></xsf:button>
          <xsf:button action="xOptional::insert" xmlToEdit="Label_16"
             caption="Label"></xsf:button>
       </xsf:menu>
    </xsf:menuArea>

©2003-2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp