Consulting

Results 1 to 1 of 1

Thread: VBA reply while maintaining the original message location issue

  1. #1

    VBA reply while maintaining the original message location issue

    I looked through the search function and could not locate a solution so I am hoping someone can help. I am attempting to build a standardized response tool via VBA for my emails and am currently coming across a small issue of not knowing how to adapt a line of code to work the way i want it.

    Basically once the user presses a button on the ribbon they are provided a UserForm to select what type of response they would like to send. Once selected the vba builds the HTML for the response and creates a Reply All message based on the current item in Outlook. My issue is I currently can only figure out 2 ways of doing this option 1 puts the response in the email, but the original message is lost (not good) and option 2 (the code is below) retains the original message but puts the response at the bottom, which I know is because of the "/body" piece, and i am unable to think of how to simply move the string titled msgBody to the top with the original email below. Anyone care to save me? Thank you!

    .HTMLBody = Replace(.HTMLBody, "</body>", msgBody & "</body>", , , vbTextCompare)
    Sorry after posting this I took a walk and realised that all i had to do was switch some placement around. Correct code end up as so:
    .HTMLBody = Replace(msgBody & "</body>", "</body>", .HTMLBody, , , vbTextCompare)
    Last edited by Be_Dang3rous; 11-19-2014 at 10:42 AM. Reason: *Solved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •