![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
I've got some code to BCC a recipient based on the who the message is
being sent to. It works great on about half of the computers I try it on, and about half doesn't run through the code at all. The clients are all Outlook2003, on WindowsXP. The code is in ThisOutlookSession, but it simply ignores the code on several computers. Does someone know of a setting or registry setting that is causing the code to be ignored? Thanks |
#2
|
|||
|
|||
![]()
This is the code that I am trying to run
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim objMe As Recipient If test(Item) Then Set objMe = Item.Recipients.Add("insert bcc recipient here") objMe.Type = olBCC objMe.Resolve Set objMe = Nothing End If End Sub Function test(objMail As Outlook.MailItem) As Boolean Dim objRecip As Outlook.Recipient For Each objRecip In objMail.Recipients 'when sending email to X carbon copy Y...Enter X's email address here : If objRecip = "recipient address here" Then test = True End If Next End Function It runs fine on some, doesn't launch on others. Going to see if it is just the ItemSend event or vba code in general |
#3
|
|||
|
|||
![]()
Am 16 May 2006 06:53:48 -0700 schrieb :
Did you check the security setting under Tools/Macros/Security? It must be medium or low, or youŽd have to certificate the project. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- I've got some code to BCC a recipient based on the who the message is being sent to. It works great on about half of the computers I try it on, and about half doesn't run through the code at all. The clients are all Outlook2003, on WindowsXP. The code is in ThisOutlookSession, but it simply ignores the code on several computers. Does someone know of a setting or registry setting that is causing the code to be ignored? Thanks |
#4
|
|||
|
|||
![]()
Yes it was the macro security. This is one of the first things I
checked but I ruled it out quickly as I would set it to high, and it would still work. What wasn't clear was that Outlook actually requires a restart for that change to take effect. I tried again on mine, setting it to high macro security, restarting Outlook and sure enough my code wouldn't run. Would have been nice if changing that setting gave an indication that I need to restart Outlook for the setting to take effect, or at the very least an error in Outlook similar to Excel when your macro secuirty is too high for your scripts. Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Vba Project OTM - Thisoutlooksession(code) error | XP User | Outlook and VBA | 4 | May 7th 06 04:31 PM |
Using VBA code to automate a process | [email protected] | Outlook and VBA | 7 | April 21st 06 05:26 PM |
Using VBA code to move current message to a folder | Dean | Outlook and VBA | 4 | February 26th 06 02:46 AM |
how to apply vba code to OL2003 forms ? | TimR | Outlook - Using Contacts | 1 | February 17th 06 05:41 PM |
VBA Code to check Task Status | [email protected] | Outlook and VBA | 2 | February 3rd 06 07:16 PM |