Outlook 2003 PropertyAccesor and Redemption Coding

zielonapani

New Member
Joined
Sep 5, 2013
Messages
38
Hi,
I have a code that I am trying to use within my Outlook 2003. I have made some research and I know that I won't be able to use that code unless I have newer Outlook or Redemption. I tried to update the code to RDO needs but it still doesnt work :/ Could anyone of you have a look what I am missing? Thank you
Code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim session As RDOSession
 Dim recips As Outlook.Recipients
 Dim recip As Outlook.Recipient
 Dim pa As session.PropertyAccessor
 Dim prompt As String
 Dim strMsg As String
 Dim Address As String
 Dim lLen


Set session = CreateObject("Redemption.RDOSession")
 RDOSession.Logon
Const PR_SMTP_ADDRESS As String = "http://schemas.microsoft.com/mapi/proptag/0x39FE001E"


Set recips = Item.Recipients
 For Each recip In recips
 Set pa = recip.PropertyAccessor
 
 Address = LCase(pa.GetProperty(PR_SMTP_ADDRESS))
 lLen = Len(Address) - InStrRev(Address, "@")


 Select Case Right(Address, lLen)
    Case "gmail.com"
         
    Case Else ' remove case else line to be warned when sending to the addresses
     strMsg = strMsg & " " & Address & vbNewLine
 End Select
 Next


If strMsg <> "" Then
 prompt = "This email will be sent outside of the company to:" & vbNewLine & strMsg & vbNewLine & "Please check recipient address." & vbNewLine & vbNewLine & "Do you still wish to send?"
 If MsgBox(prompt, vbYesNo + vbExclamation + vbMsgBoxSetForeground, "Check Address") = vbNo Then
 Cancel = True
 End If
 End If


End Sub
This code I have found on the webside: www.slipstick.com
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,214,929
Messages
6,122,317
Members
449,081
Latest member
tanurai

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top