Adding a Send Command to an Application

Being able to add a Send command to a document-based application's File menu is a Microsoft Windows 95 logo requirement. The same logic applies to sending a message from any application.

Design Tasks

  1. Decide whether to use Simple MAPI, CMC, MAPI, or the Active Messaging Library. See Selecting a Client Interface.
  2. Decide when to load and unload the selected interface, and when to create and destroy its session. You should share the messaging client's session, if it is active. See MAPI Sessions.

Implementation Tasks

  1. Determine whether the Send command should be enabled. Installation of messaging support in the operating system is optional, and your Send command should be disabled if the selected interface is not available. See Determining Which Client Interfaces are Installed.
  2. Load the selected interface DLL and the entry points you will need. See one of the following topics, depending upon which interface you have selected:
  3. Send a document using the selected interface. See one of the following topics, depending upon which interface you have selected:
    1. Open the default message store. See Opening a Message Store.
    2. Open the Outbox. See Opening a Folder.
    3. Add recipients to the message's recipient table. See Recipients.
    4. Add the document to the message as an attachment. See Attachments.
    5. Optionally, add text to the message. See PR_BODY.
    6. Send the message. See Sending Messages with MAPI.
    7. Release all the objects created in the preceding steps.

About Sample Source Code

See the following topics:

Sample CMC Client

Sample Routing Client

Sample RTF Utility

Sample Simple MAPI Client

Sample Timecard Application