PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Re: Help w/Redemption.

Reply

Re: Help w/Redemption.

 
Thread Tools Rate Thread
Old 23-09-2003, 10:48 PM   #1
Dmitry Streblechenko
Guest
 
Posts: n/a
Default Re: Help w/Redemption.


Your code works just fine for me. It looks like you are calling
R_GetSenderAddress() function, but you never assign its return value to a
variable.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"crappybottom" <crappy@inmypants.com> wrote in message
news:vn1e13koc83100@corp.supernews.com...
> Hello all,
> Below is a snippet of code that I am using to "get" the smtp addy of
> selected email(s).
> Problem is, it is returning the subject line.
> Where the line:
> R_GetSenderAddress (objItem)
> is, is where I will capturing the SMTP addy and writing it directly to our
> GFI blacklist
> database. That code is done, this is the last step.
>
> I am new to Outlook VBA, can someone pitch in and help ?
> Thanks.
>
> Function R_GetSenderAddress(objMsg)
> Dim strType
> Dim objSenderAE
> Dim objSMail
> Const PR_SENDER_ADDRTYPE = &HC1E001E
> Const PR_EMAIL = &H39FE001E
>
> Set objSMail = CreateObject("Redemption.SafeMailItem")
> objSMail.Item = objMsg
> strType = objSMail.Fields(PR_SENDER_ADDRTYPE)
>
> Set objSenderAE = objSMail.Sender
> If Not objSenderAE Is Nothing Then
> If strType = "SMTP" Then
> R_GetSenderAddress = objSenderAE.Address
> ElseIf strType = "EX" Then
> R_GetSenderAddress = objSenderAE.Fields(PR_EMAIL)
> End If
> End If
>
> Set objSenderAE = Nothing
> Set objSMail = Nothing
>
> End Function
>
> Sub Unsolicited()
> Dim objApp As Application
> Dim objSelection As Selection
> Dim objItem As Object
>
> Set objApp = CreateObject("Outlook.Application")
> Set objSelection = objApp.ActiveExplorer.Selection
>
> Select Case objSelection.Count
>
> Case 0
> Case Is > 1
> For Each objItem In objSelection
> If TypeOf objItem Is MailItem Then
> R_GetSenderAddress (objItem)
> 'do more stuff later
> End If
> Next
> 'SendKeys "{DELETE}"
> Case Is <= 1
> For Each objItem In objSelection
> If TypeOf objItem Is MailItem Then
> R_GetSenderAddress (objItem)
> 'do more stuff later
> End If
> Next
> End Select
>
> Set objApp = Nothing
> Set objSelection = Nothing
> Set objItem = Nothing
> End Sub
>
>



  Reply With Quote
Old 23-09-2003, 11:10 PM   #2
crappybottom
Guest
 
Posts: n/a
Default Re: Help w/Redemption.

uhhh. whoops

"Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message
news:eYCthxhgDHA.3104@TK2MSFTNGP11.phx.gbl...
> Your code works just fine for me. It looks like you are calling
> R_GetSenderAddress() function, but you never assign its return value to a
> variable.
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off