Reply to all Help needed badly

  • Thread starter Thread starter gbirdsong
  • Start date Start date
G

gbirdsong

I know nothing about VBA in outlook but I need to create a macro. I
need to be able to highlight an email in my inbox and start the macro
which will reply to all for the highlighted email with a simple
message like "got it". How do I do this? Is there another way
besides a macro?

thanks
 
Sub DoReply()
Dim itm as Object
Dim reply as Outlook.MailItem
On Error Resume Next

Set itm = Application.ActiveExplorer.Selection(1)
If itm.Class = olMail Then
Set reply = itm.ReplyAll
reply.Body = "Got it" & vbCrLf & vbCrLf & reply.Body
reply.Send
End If

Set itm = Nothing
Set reply = Nothing
End Sub

If you need basics on writing Outlook macros, see
http://outlookcode.com/article.aspx?id=49.
 
Sub DoReply()
    Dim itm as Object
    Dim reply as Outlook.MailItem
    On Error Resume Next

    Set itm = Application.ActiveExplorer.Selection(1)
    If itm.Class = olMail Then
        Set reply = itm.ReplyAll
        reply.Body = "Got it" & vbCrLf & vbCrLf & reply.Body
        reply.Send
    End If

    Set itm = Nothing
    Set reply = Nothing
End Sub

If you need basics on writing Outlook macros, seehttp://outlookcode.com/article.aspx?id=49.
that works great. thanks.
I will check out that site also.
 
Is it possible to maintain the formatting of the original email in the
reply? The reply I am producing loses the spacing, text size, and
border lines from the original.

thanks
 
The Body property contains only the plain text representation of the item
body. If you want formatting, you need to work with HTMLBody and proper HTML
tags (instead of constants like vbCrLf).

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


Is it possible to maintain the formatting of the original email in the
reply? The reply I am producing loses the spacing, text size, and
border lines from the original.

thanks
 
Back
Top