Results 1 to 7 of 7

Thread: Need add text Wrap in Mail Body Message in current VBA code

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    The best way to handle this is to access the body of the message directly. The attached is modified to do that. Then the conversion of data to HTML and the need to faff around with signatures, when the signature was already in the message body before you started to process the message, is no longer required.

    You can either write the content of the required cells directly or you can copy and paste it into a range, thereby leaving the signature in place. The multi-line cell needs no further processing when using this method, though you can treat it exactly as you would process a Word document from VBA

    As your workbook didn't have the data range to be inserted (apart from the message you quoted) it was not possible to test the insertion of that, but it should be equally straightforward e.g. after the line

    oRng.collapse 0 'collapse end

    you could identify the range to be copied and paste it into the message range. This will insert the table as it is formatted in Excel. e.g.

    Range("N2:O4").Copy
    oRng.Paste
    Attached Files Attached Files
    Last edited by gmayor; 09-20-2014 at 05:08 AM.
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

Posting Permissions

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