PDA

View Full Version : Solved: Reply keeping the body of text and Adding new line



jaureguima
06-16-2006, 10:53 AM
I was wondering if there is a way I can set a Macro to reply to an email message with the following conditions

1. Keep the body of the email I am replying to

2. CC a same group from my contacts everytime I run the Macro

3. Ad a standard response in the body

4. Ad a standard subject line to my response





Local Time: 12:48 PM
Local Date: 06-16-2006
Location: http://www.vbaexpress.com/forum/images/flags/United%20States%203D.gif http://www.vbaexpress.com/forum/images/flags/states/Texas%203D.gif

mvidas
06-19-2006, 08:52 AM
Hello,

Welcome to VBAX! You should be able to do what you're looking for by using:Sub jaureguimaReply()
Dim iMsg As Object 'MailItem
Set iMsg = Application.ActiveExplorer.Selection.Item(1)
With iMsg.Reply
With .Recipients.Add("YourContactDistributionGroupName")
.Type = olCC
.Resolve
End With
.Subject = "4. Ad a standard subject line to my response"
.Body = iMsg.Body & vbCrLf & "3. Ad a standard response in the body"
.Display 'or .Send
End With
Set iMsg = Nothing
End SubMatt

jaureguima
06-19-2006, 09:04 AM
Every thing is good but it still will not post the standard message in the body....Thanks for your help:friends:

mvidas
06-19-2006, 09:13 AM
Ok.. it is possible your emails have an HTML body instead of just plain text.. make the following change, should do what you're looking for:' .Body = iMsg.Body & vbCrLf & "3. Ad a standard response in the body"
If Len(.HTMLBody) > 0 Then
.HTMLBody = iMsg.HTMLBody & vbCrLf & "3. Ad a standard response in the body"
Else
.Body = iMsg.Body & vbCrLf & "3. Ad a standard response in the body"
End IfIf still no good, can you please give me an example of what you're looking for? What this does currently is paste your Standard Response below the original message body.. if you're looking for it reversed then switch iMsg.(html)Body and "3. Ad a standard response in the body"

jaureguima
06-19-2006, 09:13 AM
:beerchug: Figured it out my message was coming out at the bottom of the email. I just rearranged it.

jaureguima
06-19-2006, 09:15 AM
Thanks!!!