What sub or function triggered when message opens?

G

Gene

Hi everyone,

Is it possible to execute a VBScript commands when you open or read e-mail
from Inbox (Outlook)? I've tried to use the Function Item_Read() and
Function Item_Open() but it doesn't work.

Thanks.
 
S

Sue Mosher [MVP-Outlook]

Item_Open fires when the item is opened in its own window. Did you publish your form? Code doesn't run on unpublished forms.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Gene

Hi,

Yes, I did published the form in Personal Forms Library. Is there any way
to execute a code similar function with "Request a read receipt for this
message"? When you open your mail from Inbox, it fires a code asking for
action for instance.

Thanks.
 
S

Sue Mosher [MVP-Outlook]

Sure. In your scenario, this code asks if you want to request a read receipt when you create a new message :

Function Item_Open()
If Item.Size = 0 Then
strMsg = "Do you want to ask for a read receipt?"
res = MsgBox(strMsg, vbQuestion + vbYesNo, "Request Read Receipt?"
Item.ReadReceiptRequested = (res = vbYes)
End If
End Function

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top