PC Review


Reply
Thread Tools Rate Thread

Rule to reply with email and attach document

 
 
John
Guest
Posts: n/a
 
      2nd Oct 2007
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)

 
Reply With Quote
 
 
 
 
John
Guest
Posts: n/a
 
      2nd Oct 2007
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 <john.kr...@gmail.com> 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)



 
Reply With Quote
 
 
 
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      2nd Oct 2007
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" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>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 <john.kr...@gmail.com> 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)

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rule: "Reply using a specific template" doesn't reply to Reply-To: =?Utf-8?B?bWhncmVlbmU=?= Microsoft Outlook VBA Programming 8 4th Sep 2010 03:58 PM
HELP -How Do I Attach Document to BODY of Outlook NOT as an Attach ljane0791 Microsoft Outlook Discussion 3 28th Jan 2009 03:13 PM
Rule to reply with template and attach document John Microsoft Outlook Form Programming 0 2nd Oct 2007 08:14 PM
Outlook 2002 "reply" and reply all with original attach ????? =?Utf-8?B?Ym1hMTk=?= Microsoft Outlook Installation 1 7th Apr 2006 08:41 PM
Is it OK to attach scripts to reply posts. I want to attach a handy script. Stephen Windows XP General 59 8th Jun 2005 01:35 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:27 PM.