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

Auto-BCC based on Outlook account



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 22nd 08, 11:52 AM posted to microsoft.public.outlook.program_vba
yoni
external usenet poster
 
Posts: 2
Default Auto-BCC based on Outlook account

OK, I know how to add an AutoBCC:
Code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As 
Boolean)
    Dim objMe As Recipient
    Set objMe = ")
    objMe.Type = olBCC
    objMe.Resolve
    Set objMe = Nothing
End Sub
The question is, I need to add in that it should only run the BCC if the
emial was sent from a specific account in Outlook?

Thanks.
  #2  
Old May 22nd 08, 02:33 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Auto-BCC based on Outlook account

What version of Outlook? In Outlook 2007 you can use the
MailItem.SendUsingAccount property and read that, comparing it with the
NameSpace.Accounts collection of email accounts.

In earlier versions of Outlook there is no direct method of doing that. If
you are using a MAPI wrapper such as Redemption (www.dimastr.com/redemption)
you could use the undocumented properties InetAcctName
("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/8580001E"
in DASL syntax) and InetAcctID
("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/8581001E"
in DASL). InetAcctID has the email address used to send but you would have
to parse that and if the sending account is from Exchange you would need to
translate the Exchange distinguished name address into an SMTP address.

You can use a MAPI viewer such as MFCMAPI or OutlookSpy (www.dimastr.com) to
look at items and see how those properties are set up and what data they
contain.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"yoni" wrote in message
...
OK, I know how to add an AutoBCC:
Code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As
 Boolean)
    Dim objMe As Recipient
    Set objMe = ")
    objMe.Type = olBCC
    objMe.Resolve
    Set objMe = Nothing
 End Sub

The question is, I need to add in that it should only run the BCC if the
emial was sent from a specific account in Outlook?

Thanks.


 




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
Outlook 2003 - Signature Selected Based On Account Used seven_percent Outlook - General Queries 2 May 22nd 08 11:18 AM
Which free web-browser based mail account works with outlook? Shannon Outlook - General Queries 3 June 23rd 07 01:34 AM
Need help with auto reply based on text in body Adam_Rogers Outlook and VBA 2 March 8th 07 05:15 AM
Calendar/Web Based Account T Outlook - Calandaring 0 February 7th 07 07:17 PM
Auto-Accept Meeting Based on Sender [email protected] Outlook - Calandaring 1 January 6th 07 02:28 AM


All times are GMT +1. The time now is 05:09 AM.


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.