Results 1 to 7 of 7

Sent Email shows up with blank body

Threaded View

  1. #1
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    204

    Sent Email shows up with blank body

    Dear mr/mrs,

    Below VBA is working on outlook 2016,
    can somebody help me why the body is blank?
    I don't understand this problem, so I am looking for some help.
    Thank you in advance for your support

    Dim strbody As String
    Dim oApp As Object
    Dim oMail As Object
    Dim WB As Workbook
    Dim FileName As String
    Dim wSht As Worksheet
    Dim shtName As String
    Dim ThisFile As String
    Dim oByValue


    ThisFile = "C:\test\Test1.xlsx"
    Application.ScreenUpdating = False

    'Create and show the Outlook mail item
    Set oApp = CreateObject("Outlook.Application")
    Set oMail = oApp.CreateItem(0)

    With oMail


    .To = Sheets("Sheet1").Range("B1").Value
    .Subject = Sheets("Sheet1").Range("B2").Value


    With ThisWorkbook.Sheets("Sheet1")
    strbody = "Dear mrs Rania," & vbNewLine & vbNewLine & _
    .Range("B3") & vbNewLine & _
    .Range("B4") & vbNewLine & _
    .Range("B5") & vbNewLine & _
    .Range("B6") & vbNewLine & _
    .Range("B7") & vbNewLine & _
    .Range("B8") & vbNewLine & _
    .Range("B9")
    End With
    .Attachments.Add ThisFile
    .Attachments.Add "C:\test\Test1.xlsx", oByValue, 0

    .Display
    End With

    'Restore screen updating and release Outlook
    Application.ScreenUpdating = True
    Set oMail = Nothing
    Set oApp = Nothing
    End Sub[/CODE]
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by kirana2014; 09-08-2017 at 10:09 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to send email from excel using VBA with Cell Range (Including Images) as Email Body
    By Novice_To_Excel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-24-2014, 05:06 AM
  2. vba pull data from outlook body of email through email or subject of mail into excel
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-01-2014, 04:37 AM
  3. [SOLVED] Skipping Blank Cells in a HTML Email Body
    By bocaj315 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-24-2013, 04:03 PM
  4. Send New Email W/ Body of Received Email, Then Delete Sent Email
    By edneal2 in forum Outlook Formatting & Functions
    Replies: 2
    Last Post: 07-01-2013, 12:45 AM
  5. Skipping blank cells in Email body
    By bocaj315 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-21-2013, 12:19 PM
  6. Replies: 5
    Last Post: 06-09-2013, 12:27 PM
  7. Replies: 6
    Last Post: 12-02-2011, 02:14 PM
  8. Replies: 0
    Last Post: 04-07-2009, 04:42 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1