Last modified: July 23, 2011
Applies to: Outlook
Requests that the form perform whatever tasks it associates with a specific verb.
Form viewers call the IMAPIForm::DoVerb method to request that the form perform the tasks that it associates with each verb that the form supports.
Each of the supported verbs is identified by a numeric value, passed to DoVerb in the iVerb parameter. Typical implementations of DoVerb contain a switch statement that tests the values that are valid for the iVerb parameter for the form.
If the form viewer specifies a view context in the lpViewContext parameter, use it in your DoVerb implementation instead of the view context passed in an earlier call to the IMAPIForm::SetViewContext method. Make whatever changes are necessary to your internal data structures and do not save the view context.
Perform the following tasks in your DoVerb implementation:
Execute whatever code is necessary for the particular verb that is associated with the iVerb parameter.
If necessary, restore the original view context.
If an unknown verb number was passed in, return MAPI_E_NO_SUPPORT. Otherwise, return a result based on the success or failure of whatever verb was executed.
Close the form. It is always your responsibility to close the form after a DoVerb call completes.
Some verbs, such as Print, should be modal with respect to the DoVerb call — that is, the indicated operation must be finished before the DoVerb call returns.
To obtain the RECT structure used by a form's window, call the GetWindowRect function.
Do not save the handle in the hwndParent parameter because, although it usually remains valid until the completion of DoVerb, it can be destroyed immediately upon the call's return.
You can make non-modal verbs act as modal verbs by pointing lpViewContext to a view context implementation that returns the VCSTATUS_MODAL flag from its IMAPIViewContext::GetViewStatus method.