![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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! |
Ads |
#2
|
|||
|
|||
![]()
Yes, that's possible. I'll get the code and some instructions together and
post them as quick as I can (sometime tomorrow). -- David Lee - MVP Outlook "mhgreene" wrote: Is it possible to write a script to to be used in a rule that could accomplish this? |
#3
|
|||
|
|||
![]()
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\S ample Reply Template.oft") olkTemplate.Recipients.Add olkReply.Recipients.Item(1).Address olkTemplate.Recipients.ResolveAll olkTemplate.Send Set olkReply = Nothing Set olkTemplate = Nothing End Sub -- David Lee - MVP Outlook ! |
#4
|
|||
|
|||
![]()
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\OneSourceSalesSaturnFirst Response.oft") olkTemplate.Recipients.Add olkReply.Recipients.Item(1).Address olkTemplate.Recipients.ResolveAll olkTemplate.Send Set olkReply = Nothing Set olkTemplate = Nothing End Sub "D.Lee" wrote: 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\S ample Reply Template.oft") olkTemplate.Recipients.Add olkReply.Recipients.Item(1).Address olkTemplate.Recipients.ResolveAll olkTemplate.Send Set olkReply = Nothing Set olkTemplate = Nothing End Sub -- David Lee - MVP Outlook ! |
#5
|
|||
|
|||
![]()
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 "D.Lee" wrote: 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\S ample Reply Template.oft") olkTemplate.Recipients.Add olkReply.Recipients.Item(1).Address olkTemplate.Recipients.ResolveAll olkTemplate.Send Set olkReply = Nothing Set olkTemplate = Nothing End Sub -- David Lee - MVP Outlook ! |
#6
|
|||
|
|||
![]()
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 "mhgreene" wrote: 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\OneSourceSalesSaturnFirst Response.oft") olkTemplate.Recipients.Add olkReply.Recipients.Item(1).Address olkTemplate.Recipients.ResolveAll olkTemplate.Send Set olkReply = Nothing Set olkTemplate = Nothing End Sub "D.Lee" wrote: 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\S ample Reply Template.oft") olkTemplate.Recipients.Add olkReply.Recipients.Item(1).Address olkTemplate.Recipients.ResolveAll olkTemplate.Send Set olkReply = Nothing Set olkTemplate = Nothing End Sub -- David Lee - MVP Outlook ! |
#7
|
|||
|
|||
![]()
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 "D.Lee" wrote: 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\S ample Reply Template.oft") olkTemplate.Recipients.Add olkReply.Recipients.Item(1).Address olkTemplate.Recipients.ResolveAll olkTemplate.Send Set olkReply = Nothing Set olkTemplate = Nothing End Sub -- David Lee - MVP Outlook ! |
#8
|
|||
|
|||
![]()
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 "Erik" wrote in message ... 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 "D.Lee" wrote: 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\S ample Reply Template.oft") olkTemplate.Recipients.Add olkReply.Recipients.Item(1).Address olkTemplate.Recipients.ResolveAll olkTemplate.Send Set olkReply = Nothing Set olkTemplate = Nothing End Sub -- David Lee - MVP Outlook ! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
why is "reply" tab always in Grey? can't click on "reply" to email | onepoint | Outlook - General Queries | 3 | September 14th 06 04:38 AM |
Outlook "freezes" on "reply" when I set Word as my HTML editor? | louis11 | Outlook - Installation | 0 | May 12th 06 05:43 PM |
Outlook "freezes" on "reply" when I set Word as my HTML editor? | louis11 | Outlook - Installation | 0 | May 12th 06 05:40 PM |
Outlook 2002 "reply" and reply all with original attach ????? | bma19 | Outlook - Installation | 1 | April 7th 06 09:41 PM |
Change "Reply To" Rule | [email protected] | Outlook and VBA | 0 | March 1st 06 10:47 AM |