Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AutoReply with original subject & body (no template) 1

Status
Not open for further replies.

talco

Instructor
Jan 31, 2007
6
IL

Hey friends,

I want to build a rule that will Auto-replay messages with the original message inside (and also the subject line).
Exactly as if I presses REPLY manually - The idea is to give a "Reciept" to my students that are sending their work's to my email.

Now I can only do that with a pre-build template, not good for me.

Please help, and Thank's !!!!

Tal
 
Hey, Thanks for your help.

I can't use the assistant - I dont use Exchange server.

and the basic rules are not smart enough.

Still looking for the right way, maybe something with VBA...

Tal
 
Hey,
It's the same thing, the advanced options are for Exchange server users.

I would be glad to use VBA, but I can find a decent place to learn the commands from...
If you guys know something, I would be thankful.

Good Day
Tal
 
Alright, didn't test this code and VBA isn't exactly something I use regularly but I think this should do what you want. All you would need to do (I believe...) is select the emails you wish to reply to and run this macro. Modify what you want for the message and any other mailitem properties, but this should work. Let me know if you have any problems.

Sub AutoReply()
Dim oOutlook As New Outlook.Application
Dim oExplorer As Outlook.Explorer
Dim oSelection As Outlook.Selection
Dim oMsg As Outlook.MailItem
Dim oReply As Outlook.MailItem
Dim sBody As String
Dim x As Integer
Dim i As Integer

Set oExplorer = oOutlook.ActiveExplorer
Set oSelection = oExplorer.Selection

For x = 1 To oSelection.Count
Set oMsg = oSelection.Item(x)
Set oReply = oSelection.Item(x).Reply

sBody = "Your message here....."
sBody = sBody & "Received file(s): "

For i = 1 To oMsg.Attachments.Count
sBody = sBody + oMsg.Attachments.Item(i).DisplayName
Next i

oReply.Send
Next x

End Sub


-jhaith

*Code posted is not guaranteed to work, use at own risk...
 
Don't write "it shuold work.."

It is working!!!!
Thank's for the effort, that's really what i've been looking for.

But now to end this Saga, I have to find a way to run the macro upon an arriving of mail's that answer the my conditions.

The problem is that the Outlook rules system cannot call a macro.

Though, I saw there "Run a script", and "Personalized action" but I can't understand how to use them even if they could help here.
 
Hey, me again
Found a solution for that, I added "MyMail As MailItem" in the brackets after the sub name, and then I was able to call the macro from a rule (under "Run a Script").

Now the problem is different, I have to sort my messages to different directories, and when applying the rule, first it moves the message to it's dir. and then run the macro, and the macro is processing other item that outlook is standing on now (still in the inbox, the arrived message went to it's dir.)

I think its getting too complicated now, I dont know a way to tell outlook first to run the macro and just then sort the message to its place.
 
Create a rule that runs the script, then another rule that moves the items. Make sure that the script runs first in order or importance. Think that will work. Otherwise, you could just fully automate it and finish the code I gave you ;)

-jhaith
 
Hey,

Did that, set the rules.
I also cuntinued developing the code a little bit.... but,
There is another problem now, every time the Macro is trying to send the mail, I got a messgae saying: "A program is trying to automatically send e-mail on your behalf..."

I didnt find no serious free way to handle this, only a freeware that wait 5 seconds each time to approve this message...

What we are doing now???
I am so close to the final solution with your help, we will not fail now !
 
Alright, we'll get this working yet, haha. This could get a little tricky now, couple questions first. What type of email server are you using, POP3? Are you checking your email on an intranet with the mail server being local?

-jhaith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top