![]() |
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
|
|||
|
|||
![]()
Anyone have any suggestions on the best way to do this: rule applied
to a received email that replies with an email containing an attachment. The reply is based upon the received email's subject. I know about creating a rule and using a template. However, I don't want to save the attachment with the template. I'm constantly updating the file/attachment and would prefer linking/attaching the file. For example, an email is received with "today's data" in the subject. A rule responds by sending an email with the current data file attached. I'm familar with Excel/Access VBA---Outlook scripting is a bit less...friendly. Thanks for any help! (Sorry, I'd posted this in program_forms be accident) |
Ads |
#2
|
|||
|
|||
![]()
I think I might be on a (good?) track with some code I found (Sue
Mosher) below. I've created a rule that runs this script. I should be able to add the attachment here. Sub RunAScriptRuleRoutine(MyMail As MailItem) Dim strID As String Dim olNS As Outlook.NameSpace Dim msg As Outlook.MailItem Dim rpl as Outlook.MailItem strID = MyMail.EntryID Set olNS = Application.GetNamespace("MAPI") Set msg = olNS.GetItemFromID(strID) ' do stuff with msg, e.g. Set rpl = msg.Reply rpl.Body = "some extra text" & vbCrLf & rpl.Body rpl.Send Set msg = Nothing Set olNS = Nothing End Sub On Oct 2, 12:16 pm, John wrote: Anyone have any suggestions on the best way to do this: rule applied to a received email that replies with an email containing an attachment. The reply is based upon the received email's subject. I know about creating a rule and using a template. However, I don't want to save the attachment with the template. I'm constantly updating the file/attachment and would prefer linking/attaching the file. For example, an email is received with "today's data" in the subject. A rule responds by sending an email with the current data file attached. I'm familar with Excel/Access VBA---Outlook scripting is a bit less...friendly. Thanks for any help! (Sorry, I'd posted this in program_forms be accident) |
#3
|
|||
|
|||
![]()
Indeed:
rpl.Attachments.Add "C:\somefile.txt" -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "John" wrote in message ups.com... I think I might be on a (good?) track with some code I found (Sue Mosher) below. I've created a rule that runs this script. I should be able to add the attachment here. Sub RunAScriptRuleRoutine(MyMail As MailItem) Dim strID As String Dim olNS As Outlook.NameSpace Dim msg As Outlook.MailItem Dim rpl as Outlook.MailItem strID = MyMail.EntryID Set olNS = Application.GetNamespace("MAPI") Set msg = olNS.GetItemFromID(strID) ' do stuff with msg, e.g. Set rpl = msg.Reply rpl.Body = "some extra text" & vbCrLf & rpl.Body rpl.Send Set msg = Nothing Set olNS = Nothing End Sub On Oct 2, 12:16 pm, John wrote: Anyone have any suggestions on the best way to do this: rule applied to a received email that replies with an email containing an attachment. The reply is based upon the received email's subject. I know about creating a rule and using a template. However, I don't want to save the attachment with the template. I'm constantly updating the file/attachment and would prefer linking/attaching the file. For example, an email is received with "today's data" in the subject. A rule responds by sending an email with the current data file attached. I'm familar with Excel/Access VBA---Outlook scripting is a bit less...friendly. Thanks for any help! (Sorry, I'd posted this in program_forms be accident) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I use a rule to reply to an email? | RichardM | Outlook and VBA | 4 | April 13th 07 06:58 PM |
Attach a page or two of a multi-page Word 2003 document | brett | Outlook Express | 6 | December 12th 06 09:56 PM |
attach publishser document on outlook to someone who doesn't have | mindy | Outlook - Using Contacts | 1 | June 12th 06 07:12 AM |
Outlook 2002 "reply" and reply all with original attach ????? | bma19 | Outlook - Installation | 1 | April 7th 06 09:41 PM |
Code to attach more than 1 document | Jas | Outlook and VBA | 1 | March 22nd 06 07:41 AM |