Item.Recipients.Add

I

Ian Sweeney

VBA in Outlook 2003 - ThisOutlookSession

This code was working but now it does nothing when I send an email. What
could be the problem?

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim objMe As Recipient
Set objMe = Item.Recipients.Add("(e-mail address removed)")
objMe.Type = olBCC
objMe.Resolve
Set objMe = Nothing
End Sub
 
S

Sue Mosher [MVP-Outlook]

Does other VBA code run?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
I

Ian Sweeney

I don't think I'm running any other VBA.

I was so pleased when this initially worked that I sent it to seven other
members of the team I'm working with. Looking at the mailbox where the BCC
messages were sent, it appears that they all got it working when they
installed it because I see messages in there from of of them, but ONLY FOR
THE DAY IT WAS INSTALLED. Nothing after that.


P.S. Sue, are you really just one person? If so, I'd like to say thanks for
all of the help you've given on various Outlook webpages/newsgroups over the
years.
 
S

Sue Mosher [MVP-Outlook]

My questions was aimed at testing whether there is a problem with your VBA environment. Run this code:

Sub Hello()
MsgBox "Hello"
End Sub

and tell us whether you get a Hello message.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


Ian Sweeney said:
I don't think I'm running any other VBA.

I was so pleased when this initially worked that I sent it to seven other
members of the team I'm working with. Looking at the mailbox where the BCC
messages were sent, it appears that they all got it working when they
installed it because I see messages in there from of of them, but ONLY FOR
THE DAY IT WAS INSTALLED. Nothing after that.
 
I

Ian Sweeney

VBA macros were blocked. I have run selfcert.exe and digitally signed the
macro and all seems to be OK at present. Thanks.

Why did it work when I first added the code? Why did it work when the others
first added the code?

I can't afford to go down the route of paying Verisign vast sums of money
for digital signatures. How can I make this small code snippet work on a
small number of PCs (<10)? The users are not technically minded, and not
nearby otherwise I'd do it manually myself.
 
S

Sue Mosher [MVP-Outlook]

Why did it work when I first added the code? Why did it work when the others
first added the code?

It's impossible to know.
I can't afford to go down the route of paying Verisign vast sums of money
for digital signatures. How can I make this small code snippet work on a
small number of PCs (<10)? The users are not technically minded, and not
nearby otherwise I'd do it manually myself.

If you're going to use VBA and not create an add-in, copy the code into each person's VBA environment, run Selfcert.exe to create a certificate for that person, sign the code, and you should be OK.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top