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
This code I have found on the webside: www.slipstick.com
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