Previous Thread:   VBA: New Mail + Options + Security Settings

9/28/2005 10:27:13 AM    BCC on one of several email accounts
I'm trying to set up a VB routine that will automatically do a bcc on all  
  
outgoing emails when sending from one particular email account.  I have 4  
  
email accounts that I use in Outlook 2003 and when I send an email from the  
  
'sales' account, I want all emails bcc'd to another email account.  
  
I've set up a routine that will bcc all emails (from all accounts) using  
  
ItemSend, but I can't figure out how to make this happen for just a single  
  
account.  Any thoughts?  Thanks.



9/28/2005 1:34:18 PM    Re: BCC on one of several email accounts
Outlook doesn't provide any direct way to detect the account for an =  
  
outgoing message. See=20  
  
http://www.outlookcode.com/codedetail.aspx?id=3D889 for various =  
  
workarounds that might fit your scenario.=20  
  
--=20  
  
Sue Mosher, Outlook MVP  
  
Author of Configuring Microsoft Outlook 2003  
  
http://www.turtleflock.com/olconfig/index.htm  
  
and Microsoft Outlook Programming - Jumpstart for=20  
  
Administrators, Power Users, and Developers  
  
http://www.outlookcode.com/jumpstart.aspx  
  
"Randy" <rreynard@hotmail.com> wrote in message =  
  
news:BOidnRksjOvoT6feRVn-rw@comcast.com...  
  
all=20  
  
have 4=20  
  
from the=20  
  
using=20  
  
single=20

9/28/2005 11:27:06 PM    Re: BCC on one of several email accounts
Thanks for the response Sue!  Perhaps a more simple way to do what I need is  
  
if I can get access to the 'From' address in the outgoing mail...is that  
  
field accessible?  I'd like to stay within the ItemSend application  
  
subroutine....  
  
It's been a while since I've done programming....is the whole email record  
  
sent into ItemSend before the email is actually sent?  Or, does ItemSend  
  
just pass variable back to the mail item?  If the email record is sent to  
  
the ItemSend routine, does a list exist somewhere of the variables contained  
  
within the Object record?  
  
"Sue Mosher [MVP-Outlook]" <suemvp@outlookcode.com> wrote in message  
  
news:Oe4uClLxFHA.736@tk2msftngp13.phx.gbl...  
  
Outlook doesn't provide any direct way to detect the account for an outgoing  
  
message. See  
  
http://www.outlookcode.com/codedetail.aspx?id=889 for various workarounds  
  
that might fit your scenario.  
  
--  
  
Sue Mosher, Outlook MVP  
  
Author of Configuring Microsoft Outlook 2003  
  
http://www.turtleflock.com/olconfig/index.htm  
  
and Microsoft Outlook Programming - Jumpstart for  
  
Administrators, Power Users, and Developers  
  
http://www.outlookcode.com/jumpstart.aspx  
  
"Randy" <rreynard@hotmail.com> wrote in message  
  
news:BOidnRksjOvoT6feRVn-rw@comcast.com...

9/29/2005 11:19:47 AM    Re: BCC on one of several email accounts
Unless the user has manually set a From address for a specific message, =  
  
Outlook doesn't provide that information until *after* the item has been =  
  
sent and is in the Sent Items folder.=20  
  
The Item object passed as a parameter in the ItemSend event handler is =  
  
the actual item that is in the process of being sent. The object browser =  
  
(press F2 in VBA) can show you the MailItem properties.=20  
  
--=20  
  
Sue Mosher, Outlook MVP  
  
Author of Configuring Microsoft Outlook 2003  
  
http://www.turtleflock.com/olconfig/index.htm  
  
and Microsoft Outlook Programming - Jumpstart for=20  
  
Administrators, Power Users, and Developers  
  
http://www.outlookcode.com/jumpstart.aspx  
  
"Randy" <rreynard@hotmail.com> wrote in message =  
  
news:Ue-dncVWKdLYFKbeRVn-oQ@comcast.com...  
  
need is=20  
  
that=20  
  
record=20  
  
ItemSend=20  
  
to=20  
  
contained=20  
  
outgoing=20  
  
workarounds=20  
  
all  
  
have 4  
  
from=20  
  
using  
  
single

9/29/2005 12:12:31 PM    Re: BCC on one of several email accounts
Isn't THAT just frustrating!!!  hmmmmmm.....now what to do?!  I see people  
  
selling outlook add-in software that will do a Bcc for all emails, but I'm  
  
sure they do it for all accounts too.  
  
Once again, I appreciate your response.  'F2' was the magic list that I was  
  
looking for.  
  
I put the ItemSend object in the watch list and saw that the  
  
'SenderEmailAddress' field is "" (blank).  The only solution I can think of  
  
is to write a macro that gets the mail from the Sent folder, extracts the  
  
account info, then creates a new message and sends it.  But, this seems real  
  
messy.  
  
When replying to a received email, can you tell me if there is a way to  
  
extract the 'To' address from the received email during the ItemSend event?  
  
If so, at least I can do a Bcc on email replys, but not on new emails  
  
generated from that account.  I looked through the object, but I can't seem  
  
to find this info....I'm SURE it is there though!  
  
-randy  
  
"Sue Mosher [MVP-Outlook]" <suemvp@outlookcode.com> wrote in message  
  
news:%23GgIezQxFHA.916@TK2MSFTNGP10.phx.gbl...  
  
Unless the user has manually set a From address for a specific message,  
  
Outlook doesn't provide that information until *after* the item has been  
  
sent and is in the Sent Items folder.  
  
The Item object passed as a parameter in the ItemSend event handler is the  
  
actual item that is in the process of being sent. The object browser (press  
  
F2 in VBA) can show you the MailItem properties.  
  
--  
  
Sue Mosher, Outlook MVP  
  
Author of Configuring Microsoft Outlook 2003  
  
http://www.turtleflock.com/olconfig/index.htm  
  
and Microsoft Outlook Programming - Jumpstart for  
  
Administrators, Power Users, and Developers  
  
http://www.outlookcode.com/jumpstart.aspx  
  
"Randy" <rreynard@hotmail.com> wrote in message  
  
news:Ue-dncVWKdLYFKbeRVn-oQ@comcast.com...

9/29/2005 11:57:06 PM    Re: BCC on one of several email accounts
The To information might be in any of these places:=20  
  
1) The body of the reply item being sent, if you didn't delete the reply =  
  
header.=20  
  
2) Any message open in the Inspectors collection.=20  
  
3) Application.ActiveExplorer.Selection(1) if you are replying to an =  
  
item selected in a folder and haven't changed the selection since you =  
  
started the reply.=20  
  
4) None of the above.=20  
  
What about writing a macro to (a) create the reply and (b) add the Bcc =  
  
at the time of creation?=20  
  
--=20  
  
Sue Mosher, Outlook MVP  
  
Author of Configuring Microsoft Outlook 2003  
  
http://www.turtleflock.com/olconfig/index.htm  
  
and Microsoft Outlook Programming - Jumpstart for=20  
  
Administrators, Power Users, and Developers  
  
http://www.outlookcode.com/jumpstart.aspx  
  
"Randy" <rreynard@hotmail.com> wrote in message =  
  
news:sv2dnVAA8MU6oaHenZ2dnUVZ_smdnZ2d@comcast.com...  
  
to=20  
  
event?=20  
  
seem=20  
  
message,=20  
  
been=20  
  
the=20  
  
(press=20  
  
need=20  
  
that  
  
record  
  
ItemSend  
  
sent to  
  
workarounds  
  
on all  
  
have 4  
  
from  
  
using