Template questions please!

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

I want to use a word to make a email template for use in a rule as a
autoresponse.

Can I pass a string value into the word template when my rule runs the
script? I'm parseing out the name from the body of the incoming email
and want to pass that string (strFirstName)into a bookmark, in the body
of the word template.

I also want to include a couple of .jpg files, and hyperlinks in the
template, so that it can be read by any reciepient regardless of their
email client.

I've already tries a word.htm file saved in a .oft template, but when I
try to pass the string in, the graphics are attached rather than be
visible in the template.

When viewed in Outlook express it's all text.

code I'm using...

Set objItem = Application.CreateItemFromTemplate("C:\Documents and
Settings\My Documents\Autorespond.oft")
objItem.To = "outlookclient.com"
objItem.CC = "outlookexpressclient.net"
objItem.Subject = "Thank you for choosing"
objItem.Body = "Dear " & strFirstName & "," & vbCrLf & objItem.Body
objItem.Send

Set objItem = Nothing
Set olNS = Nothing

Is this possible?

I've had trouble finding refrences to this type of application.

Thanks in advance!

Bob
 
Umm, okay i'm not 100% sure if this helps, but if you go into outlook
->tools -> mail format uncheck use word as the default editor. Then
make a new mail message put in everything you want, and save as a
template. then reference that template in your code. For some reason
i tried to make a template using word and html, but it always threw off
the format from the way it originally looked.

Heres some code I used to do a custom reply with html body


Dim objItem As Object
Dim objReply As MailItem
Dim strText As String
Dim objMail2 As Outlook.MailItem
Dim objApp As Outlook.Application
Set objItem = GetCurrentItem()
Dim substring As String
Dim strpath As String 'path of the template

strpath = "Z:\My Documents\Button Replies\Set Up Interview.oft"
Set objMail2 = CreateItemFromTemplate(strpath)
substring = objMail2.HTMLBody
Set objReply = objItem.Reply

Dim subtext As String
subtext = objItem.Subject

objReply.BCC = "(e-mail address removed)"
objReply.Subject = subtext & " BRIDGE FOR JD"

'pops up the window
objReply.BodyFormat = olFormatHTML
objReply.HTMLBody = substring & objItem.HTMLBody
objReply.Display

end sub

And instead of ojbReply.Display, I think .Send will send it,
That's most of my code but i use another funtion so its not going to
work, but that will give you an idea.
 
Back
Top