How to Include Return Receipt Functionality w/ MAPI Control

Last reviewed: June 21, 1995
Article ID: Q104624
The information in this article applies to:

- Professional Edition of Microsoft Visual Basic programming system

  for Windows, version 3.0

SUMMARY

This article explains how to install return receipt functionality on a message sent in a Visual Basic application. When a message has return receipt functionality, it means that when the message you sent is opened by the recipient, a message is sent back to you to confirm that the message was opened by the recipient. The returned message typically contains the date, time, and original message subject.

MORE INFORMATION

In Visual Basic, you can send a message by calling the automatic dialog box or by manually programming the message properties.

Using the automatic dialog box, the sender can select the Return Receipt option in the Send Note dialog box.

To manually program Return Receipt functionality, use the following example as a guide:

   ' set up a session associated with the message:
   Const SESSION_SIGNON = 1
   mapisession1.Action = SESSION_SIGNON
   mapimessages1.SessionID = mapisession1.SessionID

   ' Send the message
   Const MESSAGE_SEND = 3
   mapimessages1.MsgIndex = -1                        ' The compose buffer
   mapimessages1.MsgNoteText = "How's it going?"      ' The message text
   mapimessages1.MsgOrigAddress = "FredBloggs"        ' Sender's alias
   mapimessages1.MsgSubject = "Hi"                    ' The message title
   mapimessages1.RecipDisplayName = "JoSmith"         ' Recipient's alias
   mapimessages1.MsgReceiptRequested = True           ' Request receipt
   mapimessages1.Action = MESSAGE_SEND                ' Send message

Below is the example code that traps whether Request Receipt has been set. Place this code at the point where the user reads the message.

   If mapimessages1.MsgReceiptRequested Then          ' Check Return
receipt
      mapimessages1.MsgIndex = -1                     ' Compose buffer
      mapimessages1.RecipDisplayName = sender$        ' Set sender to
receiver
      mapimessages1.MsgSubject = "RECEIVED " + title$ ' Set message title
      mapimessages1.Action = MESSAGE_SEND             ' Send Return Receipt
   End If

The variables sender$ and title$ contain the alias and the message title of the original message.


Additional reference words: 3.00
KBCategory: kbprg
KBSubcategory: PrgCtrlsCus


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.