Outlook 2007 Macro Reply to E-mail

Status
Not open for further replies.

LMS

Senior Member
Outlook version
Email Account
Exchange Server
I found the following code that when I receive a email, I run this and it creates an email back of the template I put in and adds the email message from the other side at the bottom, but does not create the email address back to the email address from I received...so what can we add and where so it adds the email address of the email I received to the To field automatically? I need this as I get emails in certain ways just to respond using a template. Thanks much as usual!!

Sub Reply_Scripting()
Dim origEmail As mailItem
Dim replyEmail As mailItem
Set origEmail = Application.ActiveWindow.Selection.Item(1)
Set replyEmail = Application.CreateItemFromTemplate("C:\Users\Stoler Law\AppData\Roaming\Microsoft\Templates\E-mail From Lou Stoler - Good Morning Follow-Up Marketing to E-Mail Contacts.oft ")
replyEmail.HTMLBody = replyEmail.HTMLBody & origEmail.Reply.HTMLBody
replyEmail.Display
End Sub
 
And I found this code that replies to the email address of what was sent to me, but can't figure out how to reply using my template....so either code to be changed so the first one goes the email address of who sent, or this one, we add the template as the reply:

Public Sub ReplyWithHTML()
Dim oMail As outlook.mailItem
Dim oFSO
Dim oFS
If Application.ActiveExplorer.Selection.Count Then
If TypeOf Application.ActiveExplorer.Selection(1) Is outlook.mailItem Then
Set oMail = Application.ActiveExplorer.Selection(1).Reply
oMail.Display
End If
End If
End Sub
 
Thanks much. I will try it. Please tell me where to put what you posted.
 
Between the Set replyEmail line where you create the message and the .display line. :)
 
Yep, that is fine.
 
Both of them work perfectly!!!! But my automatic signature does not show up any place in the email.....anything to do for that?
 
Here is the code...and the signature of me shows up right after the template email....and secondly, after the email message from the other side that is below my reply email.....is there a way in the code, that there is no signature at the bottom of the email after the email message from the other side?

Sub Reply_Good_Morning_Follow_Up_Marketing_Reply_to_Bank_Approved_Contact_Emailtest()
Dim origEmail As mailItem
Dim replyEmail As mailItem
Dim oRespond As outlook.mailItem
Set origEmail = Application.ActiveWindow.Selection.Item(1)
Set replyEmail = Application.CreateItemFromTemplate("C:\Users\Stoler Law\AppData\Roaming\Microsoft\Templates\E-mail From Lou Stoler - Good Morning Follow-Up Marketing Reply to Bank Approved Contact Email.oft ")
replyEmail.HTMLBody = replyEmail.HTMLBody & origEmail.Reply.HTMLBody
replyEmail.Subject = "From Lou Stoler - Attorney at Law"

replyEmail.To = origEmail.SenderEmailAddress
replyEmail.Display
End Sub
 
You want to add the signature? You can save the template with a signature. :)

you can't call a command to insert the signature, you need to add it to the body code using

txtSig = "Lou" & vbcrlf & vbcrlf
replyEmail.HTMLBody = replyEmail.HTMLBody & txtSig & origEmail.Reply.HTMLBody

if you insert HTML, you need to use the raw html code: "<a href=" & chr(34) & "http://myweb" & chr(34) & ">Lou</a>"
 
You don't understand ...look at what I said at my last major post and it says how the two signatures show up...please read that...and let me know please
 
is the signature in the template?

this part is copying the signature if its in the template and it may also be added automatically when you start the new message -
replyEmail.HTMLBody = replyEmail.HTMLBody &
 
I have the normal settings that all emails I send or reply use the signature....but it is not in the template....so I just want the signature at the bottom not to show up as when I reply using my template per the code, it shows my email, my signature and below the email message I received....so just don't want the signature below the email message I received that show up in my reply....hope that makes sense.
 
I did the following and it takes off the signature of the bottom and my signature is still at top as a reply, but the email does not show up: so what to add so it runs the template but not another signature automatically:

replyEmail.HTMLBody = origEmail.Reply.HTMLBody
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
S Macro for other actions - Outlook 2007 Outlook VBA and Custom Forms 23
L Outlook 2007 - Macro Re Search Using Outlook 16
L Outlook 2007 Macro to Contact From a Field Using Outlook 3
L Outlook 2007 Macro Save Contact Using Outlook 10
L Outlook 2007 Macro Search Contacts Using Outlook 9
L Outlook 2007 Macro to LinkedIn Using Outlook 3
L Outlook 2007 Macro Open Contact Folder Using Outlook 7
L Macro to Open a Specific Word Document - Outlook 2007 Using Outlook 17
L Outlook 2007 Macro For Views Using Outlook 10
L Outlook 2007 Macro to Run a Script From a Contact Form Using Outlook 41
L Outlook 2007 Macro to Add Text to a Contact Field Using Outlook 10
F Help with Outlook 2007 Macro Please! Using Outlook 4
D outlook 2003/2007 macro query Using Outlook 2
L Outlook 2007 Macro to Email Field Using Outlook 31
O Macro for creating hyperlinks in Outlook 2007 Using Outlook 3
S Outlook 2007 Macro for replying to an e-mail. Outlook VBA and Custom Forms 1
J Can't run macro Outlook 2007 that was created in Word 2007 Outlook VBA and Custom Forms 1
I Creating an Outlook 2007 macro that attaches a signature to new me Outlook VBA and Custom Forms 1
L Help for writing an Outlook 2007 macro Outlook VBA and Custom Forms 7
D Insert Text via Macro in Outlook 2007 Outlook VBA and Custom Forms 2
G Outlook 2007 Macro: Paste - Paste Special - Unformatted Text Outlook VBA and Custom Forms 9
C After Office 2007 SP2 install - Outlook 2007 macro no longer worki Outlook VBA and Custom Forms 11
R Anyone have a sample macro for Outlook 2007 (setting the zoom)? Outlook VBA and Custom Forms 1
S Outlook 2007: automating form with macro Outlook VBA and Custom Forms 2
S How to create a macro to insert a signature in Outlook 2007 Outlook VBA and Custom Forms 1
D Outlook 2007 Recovering E-Mails Using Outlook 0
W Transfer Outlook 2016 autocomplete file to Outlook 2007 Using Outlook 1
C Outlook 2007 Removing then adding account restores junk email processing Using Outlook 0
S Outlook 2007 crash linked to gdiplus.dll Using Outlook 0
S Outlook 2007 - Automatic purge fail Using Outlook 0
J outlook 2007 doesn't let me choose which .pst to search Using Outlook 2
D Outlook 2007 vs. Outlook 2010 -- ToDo Bar Using Outlook 0
D Outlook 2007 on 365 Using Outlook.com accounts in Outlook 2
S Verwendung von Outlook 2007 Using Outlook 0
A Arthur needs help with 2007 Outlook e-mail Using Outlook.com accounts in Outlook 3
M PST import from Outlook 2007 to 2010 - Address Book contacts all in 1 group Using Outlook 4
S outlook 2007 calendar search Using Outlook 6
B Migrate Outlook 2007 to Office 365 Using Outlook 3
X I have met my waterloo trying to resolve embedded graphics problem with outlook 2007 and now 2016 Using Outlook 1
R Outlook 2007 only loads some appointments Using Outlook 0
C Move Outlook 2007 to new PC with Outlook 365 Using Outlook 3
J Outlook 2007 Hide Messages Option not Available Using Outlook 2
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 4
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 0
B Server errors Outlook 2007 Using Outlook 1
S Reboot of frozen windows7 results in changed outlook 2007 settings Using Outlook 1
S Outlook 2007 printing wrong email address at top of page Using Outlook 8
M Configure outlook 2007 to accept digital signatures Using Outlook 2
D Outlook 2007 crashes when opening an email Using Outlook 2
R New chap saying hello and needing advice on Outlook 2007 thumbnails Using Outlook 3

Similar threads

Back
Top