idiot's guide to running a script...

L

llama thumper

dear all,

apologies in advance, but am a complete VBA newbie.

I'd like to auto-BCC all my emails.

i've looked through the web, and found several links on how to do
this, using VBA:

http://groups.google.com/group/micr...01740e3454ea1d?lnk=gst&q=bcc#7101740e3454ea1d

and

http://www.outlookcode.com/d/code/autobcc.htm

i've used the approach described here:
www.outlookcode.com/article.aspx?id=49

now, once again, apologies (must sound like a _real_ newbie, which i
am!), but the problem i have is that i don't know how to actually
'run' the code.

here are the steps I take:

set the trust center to warn on all macros.

in outlook 2007, alt+f11, which opens up VBA. double click on 'this
outlook session'.
double click on microsoft office outlook objects, to expand it.
double click on 'ThisOutlookSession'.
paste in the following code on the right:

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

now: when I press F5 in VBA, or alt-F8 in outlook, i get asked for
what macro I want to run - the list is empty however.

(assuming I did manage to get it to appear as a macro, would there be
any way to automate this - ie so that every message automatically does
a BCC with an email address, without me having to run the macro each
time?).

just FYI, upon restarting outlook i did get a dialogue to approve
'thisoutlooksession', which i did. but i still don't know what to do
do actually make it work/run it.

any help would be gratefully received!
 
S

Sue Mosher [MVP-Outlook]

F5 runs a macro. The procedure you're using isn't a macro. It's an event handler. It runs automatically when the user sends an item.

Did you follow the suggested steps at http://outlookcode.com/article.aspx?id=49 to set your macro security option and create and test the HelloWorld macro? If not, I'd recommend that you do so.
 
P

piotr.redo

many thanks for your reply.

i 've followed the steps:

with the code given in the link pasted in, i press F5 and the test
message appears.

when i try the BCC code and press F5 I get prompted to run a
macro... ?
 
S

Sue Mosher [MVP-Outlook]

As I told you earlier the Bcc code isn't a macro. You can't run it with F5. You have to wait for the ItemSend event to fire. Since you've tested your VBA setup and put the code in the ThisOutlookSession module, it should run fine when you send a message. If not, test your VBA setup with the hello world macro to make sure VBA is running OK.
 

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