Outlook Macro

J

Jay Gustafson

Hello,

I don't have any experience in working with macros other than copying & pasting. So I'm hoping someone would be able to write the code for me. I'd greatly appreciate it.

I have three e-mail templates that I open up one after the other (Three different versions of my report going to different distribution lists). Is it possible to have a macro, that when played it opens up the 3 templates at the same time?

I'd totally appreciate any help with this.

Thank you,
Jay
 
S

Sue Mosher [MVP-Outlook]

Yes, it's probably possible, but you'll have to tell us the specifics of
where your email templates are kept.

In the meantime, you are bound to spend a lot of time banging your head
against the wall over little quirks if all you know how to do is copy and
paste Outlook VBA code. if you're new to Outlook VBA macros, these web
pages should help you get started writing code of your own:

http://www.winnetmag.com/Articles/Index.cfm?ArticleID=21522&pg=1
http://www.outlookcode.com/d/vb.htm


--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Hello,

I don't have any experience in working with macros other than copying &
pasting. So I'm hoping someone would be able to write the code for me. I'd
greatly appreciate it.

I have three e-mail templates that I open up one after the other (Three
different versions of my report going to different distribution lists). Is
it possible to have a macro, that when played it opens up the 3 templates at
the same time?

I'd totally appreciate any help with this.

Thank you,
Jay
 
J

Jay Gustafson

Sue,

They are kept in the default location:

C:\Documents and Settings\jgustafson\Application Data\Microsoft\Templates

The 3 templates are:

Daily - IIP Report
Daily - IIP OE Report
Daily - IIP ISG Report

Thank you,
Jay
 
S

Sue Mosher [MVP-Outlook]

But are these .oft files, i.e. Outlook templates? If so, then take a look at
the Application.CreateItemFromTemplate method. That's what you'll use to
open each one. Use the object browser to learn more: Press ALt+F11 to open
the VBA environment in Outlook, then press F2. Switch from <All Libraries>
to Outlook to browse all Outlook objects and their properties, methods, and
events. Select any object or member, then press F1 to see its Help topic.


--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

Great! Warning: Once you start automating Outlook, it's hard to stop. <g>

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Sue,

I want to thank you again for helping me. I tested it out and so far it
works perfectly. At first I had a few errors, which I had no clue what they
had meant. But I kept adding & deleting things and I finally got it.

Hopefully I can begin to learn more of the basics and begin to automate a
few other tasks.

Thank you again!
Jay Gustafson
 
S

Sue Mosher [MVP-Outlook]

Yes, this is possible. Skills you'll need:

1) Replace() function to replace text in a string

2) Outlook property syntax -- see
http://www.outlookcode.com/d/propsyntax.htm

3) Date() function for today's date (HINT: You can get yesterday's date by
using Date() -1)

4) Format() function to make the date look the way you want it to.

Performing a replacement in the body is not necessarily a straightforward
operation. Whether you use Body or HTMLBody or some other technique depends
on the message format.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Sue,

I do have another question though, and if you could let me know what
commands I should look up, I'd greatly appreciate it. As you know, I have
that macro open up 3 .oft files.

In those three templates, they're already addressed to who they're going to.
And in the Subject Line & Body the title of the report is listed. Along
with the title, I put what yesterday's date was.

Subject: " Daily - IIP Report XX-XX-XX "

Is it possible for me to write a macro, that first opens the 3 files (done)
and then once those three are open, have it search the subject line & body
of all 3 e-mails, and when it finds " XX-XX-XX " replace it with todays
date, then subtract one?

Is that even possible?

Jay
 

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