Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / September 2005

Tip: Looking for answers? Try searching our database.

BCC on one of several email accounts

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Randy - 28 Sep 2005 18:27 GMT
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.
Sue Mosher [MVP-Outlook] - 28 Sep 2005 18:34 GMT
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.

Signature

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

> 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
[quoted text clipped - 4 lines]
> ItemSend, but I can't figure out how to make this happen for just a single
> account.  Any thoughts?  Thanks.
Randy - 29 Sep 2005 07:27 GMT
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?

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.

Signature

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

> 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
[quoted text clipped - 5 lines]
> ItemSend, but I can't figure out how to make this happen for just a single
> account.  Any thoughts?  Thanks.
Sue Mosher [MVP-Outlook] - 29 Sep 2005 16:19 GMT
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.

Signature

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

> 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
[quoted text clipped - 21 lines]
>> ItemSend, but I can't figure out how to make this happen for just a single
>> account.  Any thoughts?  Thanks.
Randy - 29 Sep 2005 20:12 GMT
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

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.

Signature

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

> Thanks for the response Sue!  Perhaps a more simple way to do what I need
> is
[quoted text clipped - 25 lines]
>> single
>> account.  Any thoughts?  Thanks.
Sue Mosher [MVP-Outlook] - 30 Sep 2005 04:57 GMT
The To information might be in any of these places:

1) The body of the reply item being sent, if you didn't delete the reply header.

2) Any message open in the Inspectors collection.

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.

4) None of the above.

What about writing a macro to (a) create the reply and (b) add the Bcc at the time of creation?

Signature

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

> 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?
[quoted text clipped - 41 lines]
>>> single
>>> account.  Any thoughts?  Thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.