shanepresley
asked on
Outlook Macro to send email
I am using Outlook 2002, and would like to create a macro. I need the macro to modify the currently open email, rewrite the subject line, then send it.
I've already got the code for the subject line modification. But how do I instruct Outlook to then send the message?
I've already got the code for the subject line modification. But how do I instruct Outlook to then send the message?
Sub ms()
Set objItem = Application.ActiveInspector.CurrentItem
objItem.Subject = "TEST " & objItem.Subject
End Sub
ASKER
Hmm that's a bit of a problem. I was hoping to let the user compose a new message or reply on their own, then the new macro would modify the subject, then send.
No way to accomplish this?
No way to accomplish this?
Sorry, if the message that's open is already a new message, reply, or forward, then it's not necessary to create another. If that's the case, then this is what you want
Sub ms()
Set objItem = Application.ActiveInspector.CurrentItem
With objItem
.Subject = "TEST " & .Subject
.Send
End With
End Sub
ASKER
Excellent, getting closer! That worked, thanks! But outlook gives the user a warning, saying that a program is trying to send a message on your behalf. Any way around that?
warning.jpg
warning.jpg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent help, thank you!
You're welcome. Glad I could be of service.
You have to create a new message reply, or forward in order to send a message. You cannot send the currently open message as is. Try this
Open in new window