Help me learn: I wanna make what seems like a Word Template, but for Outlook.

D

DougB

I have a message I send to the same 5 to 6 people weekly.

I attach 3 files (updated files each week) and the text of the message
is almost always the same. Slightly different.

I'd like to put the current (or, code derived for the coming Thursday)
both in the message Subject and Body.

I'm not too bad with code, I've done lots of VBA for Word and Excel.
I've done almost nothing with Outlook, forms for VBA.

So, what I did is I created a message just like I want to send, and I
publish it as a form. That works great for the very basics. Three
things I want to try to customize tho.

1)
How can I do a search/replace or other method to modify the date
within the body of the message? The message says: Meeting is at 9:00
on 9/7/2004. I want that date to be automated for either (tomorrow)
or (the next Thursday from today)

2)
I want to do the same for the subject. Subject: Weekly meeting for
9/7/2004

3)
I'd love if it asks me to attach the three files, or even just to give
me a basic messagebox to reminding me.

Can any of you help point me in the right direction? Maybe give me
some tips or tell me a good website, or at least tell me what I want
to do? Do I need to figure out outlook VBA or Outlook Forms, or
Scripting, or what?

Thanks lots!
DougB
 
S

Sue Mosher [MVP-Outlook]

All of this probably is best done in VBA, not a custom form. If you use a
custom form, you run the risk of the attachments not being available to any
recipient who isn't using Outlook. Depending on your Office version, which
you didn't mention, it might be done in a Word template.

1) A simple replace can be done with the Replace() function operating on the
Body or HTMLBody property. However, depending on your version of Outlook and
the message format, neither of which you mentioned, this could alter any
existing formatting.

2) Set the value for the Subject property:

Set objItem = Application.ActiveInspector.CurrentItem
objItem.Subject = "Weekly meeting for " & _
FormatDateTime(Date() + 1, vbShortDate)

3) You can include code to attach the files:

objItem.Attachments.Add filename1

etc.
 

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