Forum Discussion

rajulapati's avatar
rajulapati
Contributor
4 years ago

Copy an Excel Range and paste into Outlook email and keep Source Formatting

I am trying to Copy an Excel Range and paste into Outlook email and keep Source Formatting . Tried below code and its not working

 

objDriverSheet.Range("A1:N17").Copy

Set MsOutlook = Sys.OleObject("Outlook.Application")

Dim ObjItem, MI, i, CRLF

CRLF = Chr(13) + Chr(10)
Set MI = MsOutlook.CreateItem(0)

MI.Subject = StrSubject
MI.HTMLBody =Sys.Clipboard

MI.To = Str_toemail_id

MI.Display 

MI.Send
Set MI = Nothing
Set MsOutlook=Nothing




2 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    "Tried below code and its not working" - it's helpful if you tell us what it did do and how that was different from what you wanted.

    • sonya_m's avatar
      sonya_m
      SmartBear Alumni (Retired)

      Thank you, Marsha!

       

      Hi rajulapati! Please let me know if you were able to solve this? Or, please provide the Community with more details to keep investigating this here. Thank you.