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

VBA code not starting on some Outlook 2003 clients, does on others.



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 16th 06, 03:53 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 3
Default VBA code not starting on some Outlook 2003 clients, does on others.

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  
Old May 16th 06, 04:53 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 3
Default VBA code not starting on some Outlook 2003 clients, does on others.

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  
Old May 17th 06, 06:32 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default VBA code not starting on some Outlook 2003 clients, does on others.

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  
Old May 17th 06, 06:21 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 3
Default VBA code not starting on some Outlook 2003 clients, does on others.

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


All times are GMT +1. The time now is 08:35 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.