+ Reply to Thread
Results 1 to 5 of 5

Body Text in Email

Hybrid View

  1. #1
    Registered User
    Join Date
    01-19-2006
    Posts
    10

    Body Text in Email

    Hi,

    I am sending emails from Excel using VBA. I have created the mail and it sends fine, but I want to put more than one line in the body of the email.

    So far I have the following to define the email. Which will add one line of text to the body, however I want to insert a blank line and then another line of text after the first

    With OutMail
    .To = ActiveCell.Offset(0, 8).Value
    .Subject = ActiveCell.Offset(0, 10).Value
    .body = ActiveCell.Offset(0, 9)
    .Send 'Or use Display
    End With

    Any help greatly appreciated

    Nick

  2. #2
    Forum Contributor Stuie's Avatar
    Join Date
    09-17-2006
    Location
    Suffolk, UK
    MS-Off Ver
    Excel 2003/2007
    Posts
    432
    Hi nickysquawkes,

    if you know how many lines you want you can use a vbcrlf.

    vbcrlf starts a new line.

    Example:

    "Hi" & vbcrlf & "Hello"
    this will equal:

    Hi
    Hello

    so put in two vbcrlf and get:

    Hi

    Hello

    "Hi" & vbcrlf & vbcrlf & "Hello"
    just adapt that to your code something like this:

    With OutMail
    .To = ActiveCell.Offset(0, 8).Value
    .Subject = ActiveCell.Offset(0, 10).Value
    .body = ActiveCell.Offset(0, 9) & vbcrlf & vbcrlf & "This is on diff line :)"
    .Send 'Or use Display
    End With

  3. #3
    Registered User
    Join Date
    01-19-2006
    Posts
    10
    Cheers Stuie

    Worked just right

  4. #4
    Forum Contributor Stuie's Avatar
    Join Date
    09-17-2006
    Location
    Suffolk, UK
    MS-Off Ver
    Excel 2003/2007
    Posts
    432
    No Prob

  5. #5
    Registered User
    Join Date
    10-05-2013
    Location
    Mauritius
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Body Text in Email

    hi,

    Can we add an attachment an Image to the mail.
    the image link will be indicated in any cell of the excel.
    Any suggestion?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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