Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/104624

From BetaArchive Wiki
Knowledge Base

How to Include Return Receipt Functionality w/ MAPI Control

Article ID: 104624

Article Last Modified on 1/8/2003


  • Microsoft Visual Basic 3.0 Professional Edition

This article was previously published under Q104624


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.


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:
   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
      mapimessages1.MsgIndex = -1                     ' Compose buffer
      mapimessages1.RecipDisplayName = sender$        ' Set sender to
      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 query words: 3.00

Keywords: KB104624