View Single Post
  #1  
Old May 24th 06, 03:30 PM posted to microsoft.public.outlook.program_vba
prideoflions
external usenet poster
 
Posts: 6
Default Selective Read Receipts VBA using run a script rule

Hello,

I'm running Outlook 2003 and would like the ability to always allow read
receipts from the users in my address book, but would like to choose whether
to allow a read receipt or not from anyone else. I'm attempting to do this by
setting the outlook settings to "always allow", but run the following a rule
on all incoming emails not in my contact list:

Sub PromptReadReceipt(MyMail As MailItem)
Dim strID, Display, Title As String
Dim olNS As Outlook.NameSpace
Dim Msg As Outlook.MailItem
Dim Style, Response

Display = "Do you wish to allow a read receipt?" ' Define message.
Style = vbYesNo ' Define buttons.
Title = "Read Receipt Prompt" ' Define title.

strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set Msg = olNS.GetItemFromID(strID)
If Item.ReadReceiptRequested = True Then
Response = Msgbox(Display, Style, Title)
If Response = vbNo Then
Item.ReadReceiptRequested = False
Item.OriginatorDeliveryReportRequested = False
Item.Update
End If
Else
End If
Else
End If

Set Msg = Nothing
Set olNS = Nothing
End Sub

I'm not very familiar with outlook and it's VBA code requirements, so I
Frankensteined this from code I found on multiple web pages and help menus. I
was hoping someone more experienced than I could have a look for errors/loops
before I try this out in Outlook.

Thanks!

Ads
 

Problem Mortgage - Credit Card Consolidation - Debt Consolidation - Internet Advertising - Remortgages