A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Template questions please!



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 7th 06, 06:25 PM posted to microsoft.public.outlook.program_vba
Bob
external usenet poster
 
Posts: 10
Default Template questions please!

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

  #2  
Old December 7th 06, 08:01 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 2
Default Template questions please!

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 = "
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.


Bob wrote:
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


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Questions about archiving Jamie T Outlook - Installation 2 November 22nd 06 12:21 AM
2 questions Meg Outlook - General Queries 4 November 21st 06 03:35 PM
OE 6 questions gregfarr Outlook Express 1 March 5th 06 12:21 AM
questions jpitiot Outlook Express 1 January 30th 06 05:06 AM
A few questions Raffi Bearmant Outlook - General Queries 1 January 11th 06 09:59 PM


All times are GMT +1. The time now is 07:09 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.