Reply to all Help needed badly

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
 
S

Sue Mosher [MVP]

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.
 
G

gbirdsong

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.
 
G

gbirdsong

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
 
S

Sue Mosher [MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top