Rule: "Reply using a specific template" doesn't reply to Reply-To:

M

mhgreene

I posted this in the General Questions area and based on the response that I
would need a script thought this might be the more appropiate newgroup area.

I am currently using Outlook 2003 and Windows Pro XP.

I created a rule with the action "Reply using a specific template". The
rule functions correctly EXCEPT the response email, using the template I
created, is sent to the wrong address.

I examined the Internet Headers in the incoming message and see that the
From: & Reply-To: fields have different email addresses. I want the
"Reply using a specfic template" action to send the reply to the Reply-To:
address contained in the header, instead the action sends the email to the
From: address.

If I manually open the incoming email and click "Reply" on the menu bar, the
new message created has the correct Reply-To: adrress entered into the To:
field of the new message.

I was advised that this is the way Outlook works and I would need a script
to accomplish the desired result.

Is it possible to write a script to to be used in a rule that could
accomplish this? I am upgrading to Office 2007 and ordered the book
"Microsoft Outlook 2007 Programming" by Sue Mosher. My programming skills
are basic - any direction would be appreciated.
Thanks!
 
D

D.Lee

Yes, that's possible. I'll get the code and some instructions together and
post them as quick as I can (sometime tomorrow).
 
D

D.Lee

This should do it. Follow these instructions to set this up.

1. Start Outlook.
2. Click Tools->Macro->Visual Basic Editor.
3. If not already expanded, expand Modules and click on Module1.
4. Copy the code below and paste it into the right-hand pane of the VB
Editor.
5. Edit the code as needed. I placed comment lines where things need to
change.
6. Click the diskette icon on the toolbar to save the changes.
7. Close the VB Editor.
8. Click Tools->Macro->Security.
9. Change the Security Level setting to Medium.
10. Create a rule that runs when a new message arrives. Set the rule to
run the macro.

Becuase this code accesses an address field and sends directly it is going
to trigger Outlook's built-in security. That means a pop-up dialog-box each
time it fires. Outlook security can't be turned off, but there are several
ways to work around this. The best solution is to use Outlook Redemption
(http://www.dimastr.com).

Sub ReplyWithTemplate(Item As Outlook.MailItem)
Dim olkReply As Outlook.MailItem, _
olkTemplate As Outlook.MailItem
Set olkReply = Item.Reply
'Change the template name and path on the following line
Set olkTemplate =
Application.CreateItemFromTemplate("C:\eeTesting\Sample Reply Template.oft")
olkTemplate.Recipients.Add olkReply.Recipients.Item(1).Address
olkTemplate.Recipients.ResolveAll
olkTemplate.Send
Set olkReply = Nothing
Set olkTemplate = Nothing
End Sub
 
M

mhgreene

I think I missed something!

Clicking Tools -> Macro -> Macros shows the SaturnFirstResponse named macro
in the dialog box when the Module1 code is as shown below. When I change the
Sub to read "Sub SaturnFirstResponse(Item as Outlook.MailItem), the named
macro disappears from the dialog box.

Sub SaturnFirstResponse()
Dim olkReply As Outlook.MailItem, _
olkTemplate As Outlook.MailItem
Set olkReply = Item.Reply
'Change the template name and path on the following line
Set olkTemplate = Application.CreateItemFromTemplate("C:\Documents and
Settings\greenemi.HARRISAUTO\application
data\Microsoft\Templates\OneSourceSalesSaturnFirstResponse.oft")
olkTemplate.Recipients.Add olkReply.Recipients.Item(1).Address
olkTemplate.Recipients.ResolveAll
olkTemplate.Send
Set olkReply = Nothing
Set olkTemplate = Nothing

End Sub
 
M

mhgreene

Please disregard my post dated 8/21/2007. I was able to work through my
misunderstanding of using the code you wrote.

The script does the job perfectly. A million thanks!

Mike
 
E

Erik

Thank you both for doing this. I have been searching and posting for 2 days -
Used D. Lee's script in Outlook 2000 and it worked perfectly!!

Now I am off to see how Outlook redemption can work around the security.

Thanks again - Erik
 
E

Erik

OK - - I posted the thank you but now I have a question about Outlook
Redemption. I am a little lost. With Outlook Redemtion installed, what code
would I add to the code you already submitted (which worked perfectly!) in
VB to bypass the security pop-up dialogue box?

Any help would be greatly appreciated (I looked at the FAQ in outlook
redemption and was a little confused to say the least)

Thank you again for your original post - Erik
 
E

Eric Legault [MVP - Outlook]

Take a look at this sample. Every property/method you access with the
redemptionMailItem object will bypass any security prompts.

dim redemptionMail, outlookMail
set outlookMail= Application.CreateItem(olMailItem)
set redemptionMail = CreateObject("Redemption.SafeMailItem")
redemptionMailItem = outlookMail 'never use "Set" when setting the Item
property

--
Eric Legault - MVP - Outlook
MCDBA, MCTS (Messaging & Collaboration, SharePoint Infrastructure, WSS 3
Application Development, MOSS 2007 Application Development)
Blog: http://blogs.officezealot.com/legault
Try Picture Attachments Wizard for Outlook!
http://www.collaborativeinnovations.ca
 
B

Bill Smith

I saw your post and example. I have Outlook 2003 and Redemption installed and working, but cannot get the code to work with this example. Is it possible to actually post the working code for this? thanks in advance
I posted this in the General Questions area and based on the response that I
would need a script thought this might be the more appropiate newgroup area.

I am currently using Outlook 2003 and Windows Pro XP.

I created a rule with the action "Reply using a specific template". The
rule functions correctly EXCEPT the response email, using the template I
created, is sent to the wrong address.

I examined the Internet Headers in the incoming message and see that the
From: & Reply-To: fields have different email addresses. I want the
"Reply using a specfic template" action to send the reply to the Reply-To:
address contained in the header, instead the action sends the email to the
From: address.

If I manually open the incoming email and click "Reply" on the menu bar, the
new message created has the correct Reply-To: adrress entered into the To:
field of the new message.

I was advised that this is the way Outlook works and I would need a script
to accomplish the desired result.

Is it possible to write a script to to be used in a rule that could
accomplish this? I am upgrading to Office 2007 and ordered the book
"Microsoft Outlook 2007 Programming" by Sue Mosher. My programming skills
are basic - any direction would be appreciated.
Thanks!
On Sunday, August 19, 2007 9:54 PM DLe wrote:
Yes, that is possible. I will get the code and some instructions together and
post them as quick as I can (sometime tomorrow).
--
David Lee - MVP Outlook


"mhgreene" wrote:
On Friday, March 28, 2008 4:59 PM Eric Legault [MVP - Outlook] wrote:
Take a look at this sample. Every property/method you access with the
redemptionMailItem object will bypass any security prompts.

dim redemptionMail, outlookMail
set outlookMail= Application.CreateItem(olMailItem)
set redemptionMail = CreateObject("Redemption.SafeMailItem")
redemptionMailItem = outlookMail 'never use "Set" when setting the Item
property

--
Eric Legault - MVP - Outlook
MCDBA, MCTS (Messaging & Collaboration, SharePoint Infrastructure, WSS 3
Application Development, MOSS 2007 Application Development)
Blog: http://blogs.officezealot.com/legault
Try Picture Attachments Wizard for Outlook!
http://www.collaborativeinnovations.ca


news:[email protected]...
 

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