Results 1 to 8 of 8

Email message body in VBA

This is a discussion on Email message body in VBA within the Excel Questions forums, part of the Question Forums category; Can't seem to get it right. .Body = "Here is some text" & vbLf "and here is some more text" ...

  1. #1
    MrExcel MVP Anne Troy's Avatar
    Join Date
    Feb 2002
    Location
    Allentown, PA
    Posts
    2,547

    Default

    Can't seem to get it right.

    .Body = "Here is some text" & vbLf
    "and here is some more text" & vbLf
    "and here I want a cell reference from a specific worksheet" HELP! & vbLf
    "and then some more text."

    Office 2000.

    _________________
    Anne@TheOfficeExperts.com
    TheOfficeExperts

    [ This Message was edited by: Dreamboat on 2002-10-28 01:14 ]

  2. #2
    MrExcel MVP Joe Was's Avatar
    Join Date
    Feb 2002
    Location
    Central Florida, USA
    Posts
    7,539

    Default

    [A1].Value

    or

    Worksheets("Sheet1").Range("A1").Value

    Both these add the cell contents of cell A1 to your message. Hope this helps. JSW

    _________________
    JSW[/b]

    Try and try again, " The way of the coder!"[/b]

    [ This Message was edited by: Joe Was on 2002-10-28 01:24 ]

  3. #3
    MrExcel MVP Tom Urtis's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, California USA
    Posts
    10,985

    Default

    Just tested:

    .Body = "Here is some text" & vbLf & _
    "and here is some more text" & vbLf & _
    Sheets("Sheet1").Range("A1").Value & vbLf & _
    "and then some more text."

  4. #4
    MrExcel MVP Anne Troy's Avatar
    Join Date
    Feb 2002
    Location
    Allentown, PA
    Posts
    2,547

    Default

    Doesn't work, Joe.

    Tom, yours doesn't even refer to worksheet range. I'm still working on it.
    ~Anne Troy

  5. #5
    MrExcel MVP Tom Urtis's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, California USA
    Posts
    10,985

    Default

    What kind of range are you referring to? I placed a value in cell A1 of Sheet 1 on a workbook from which I tested this line and it came out just fine on the Outlook email.


    You must be referring to some other type of range; if so, what?

  6. #6
    MrExcel MVP Anne Troy's Avatar
    Join Date
    Feb 2002
    Location
    Allentown, PA
    Posts
    2,547

    Default

    Ah. I see. YOu changed it! Trying NOW.
    ~Anne Troy

  7. #7
    MrExcel MVP Joe Was's Avatar
    Join Date
    Feb 2002
    Location
    Central Florida, USA
    Posts
    7,539

    Default

    Every step of your concatenation must have a "&" joining it to the next step!
    JSW: Try and try again: "The way of the Coder!"

  8. #8
    MrExcel MVP Anne Troy's Avatar
    Join Date
    Feb 2002
    Location
    Allentown, PA
    Posts
    2,547

    Default

    Yeah. I had it screwed up. It works fantastic!

    Thanks so much guys!

    It's T - about 4 hours. Really getting down to the wire on that one!!

    REALLY appreciate the help!
    ~Anne Troy

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com