A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

If Item.senderemailaddress Problem



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9  
Old November 5th 09, 02:43 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default If Item.senderemailaddress Problem

Still waiting for an answer to my question: If the value of
SentOnBehalfOfName isn't "DisplayName," then what is it? That may indicate
your next step.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Jeff C" wrote in message
news
Well, the code using

If Item.SentOnBehalfOfName="DisplayName" then

Works perfectly in Outlook 2003. I've tries it every which way in 2007
including using the Alias, and the actual email address without any luck.


"Jeff C" wrote in message
...

This suggestion works in Outlook 2003 but not in Outlook 2007, what
changes
need to be made?

"Sue Mosher [MVP]" wrote:

Outlook version? By "Send As account," do you mean that you're sending
as
another Exchange user? If so, try looking at the value of the
SentOnBehalfOf
property.

"Jeff C" wrote in message
...
I have been trying alternatives to the code below with no luck at
all.
The
code works fine but am trying to add the if condition to only BCC
the
strBCC
if I am using my Send As account in the exchange. Can anyone point
me
in
the
right direction? I think I am just missing something here. Thanks


Private Sub Application_ItemSend(ByVal Item As Object, _
Cancel As
Boolean)
Dim objRecip As Recipient
Dim strMsg As String
Dim res As Integer
Dim strBcc As String
On Error Resume Next

#### USER OPTIONS ####
address for Bcc -- must be SMTP address
or
resolvable
to a name in the address book

strBcc = "MySendAsMailAddress"


If Item.SenderEmailAddress =
"mysendasmailaddress.com" Then

Set objRecip =
Item.Recipients.Add(strBcc)
objRecip.Type = olBCC
If Not objRecip.Resolve Then
strMsg = "Could not resolve the Bcc
recipient. " & _
"Do you want still to send
the
message?"
res = MsgBox(strMsg, vbYesNo +
vbDefaultButton1, _
"Could Not Resolve Bcc
Recipient")
If res = vbNo Then
Cancel = True
End If
End If
End If

Set objRecip = Nothing
End Sub



.



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using SenderEmailAddress BrianL Outlook and VBA 8 June 19th 07 02:32 PM
senderemailaddress marco Outlook and VBA 1 June 7th 07 12:20 PM
SenderEmailAddress in VB.NET on Outlook 2003 [email protected] Add-ins for Outlook 1 April 10th 07 03:27 PM
Problem with Item.Size Trent Outlook - Using Forms 0 October 20th 06 03:41 PM
How to change read only SenderName and SenderEmailAddress [email protected] Outlook - General Queries 3 April 19th 06 07:22 PM


All times are GMT +1. The time now is 03:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.