View Single Post
  #4  
Old April 4th 07, 07:12 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Automated answer-template with "dyn." html



Jens, that doesn't work. You can create a rule to run a script. Then create
the e-mail and load the template yourself. You can load an *.oft file with
CreateItemFromTemplate.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - The most effective way to assign Outlook categories:
http://www.shareit.com/product.html?...4&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)

Am Tue, 3 Apr 2007 18:54:13 +0200 schrieb Jens Sommer:

Hello,

I googled a lot and tried this and that. Now the facts:

1. My rule works. Every Mail with the "correct" subject is answered with

an
template e-mail (*.oft)
2. I wrote some VBA code to get the TO-e-mail-adress into the body:
===
Sub Test()
Dim myOlApp As Outlook.Application
Dim myOlIns As Outlook.Inspector
Dim objMail As Outlook.MailItem

Set myOlApp = CreateObject("Outlook.Application")
Set myOlIns = myOlApp.ActiveInspector

Set objMail = myOlIns.CurrentItem
objMail.Body = objMail.Body & "http://www.my-server.com/test.htm&user="
& objMail.To

Set myOlApp = Nothing
Set myOlIns = Nothing
Set objMail = Nothing
End Sub
===
This also works and inserts the URL and the e-mail-address at the end of

the
body.

So my last problem is now: Merge this two together: I need the rule to
create the answer mail and then execute the code... but how?

I hope for your Ideas!

Greetings
JS

Ads