Results 1 to 1 of 1

How to make an email body in an e-mail VBA?

Threaded View

  1. #1
    Registered User
    Join Date
    12-11-2012
    Location
    bristol
    MS-Off Ver
    Excel 2007
    Posts
    40

    Question How to make an email body in an e-mail VBA?

    Hi,

    I managed to find this VBA on the internet (part of it),

     With Destwb
            .SaveAs TempFilePath & TempFileName & FileExtStr, FileFormat:=FileFormatNum
            On Error Resume Next
            With OutMail
                .to = ""
                .CC = ""
                .BCC = ""
                .Subject = ""
                .Body = "Hi,"
                .Attachments.Add Destwb.FullName
                'You can add other files also like this
                '.Attachments.Add ("C:\test.txt")
                .Display   'or use .Send
            End With
            On Error GoTo 0
            .Close savechanges:=False
        End With

    I am a VBA newbie and I dont know how to make the .Body work. How do I indicate a return? Do I have to type everything on one line? I want het email to look like this:

    Hi,

    Please do this and this and also this and not to forget this and that.

    Hope to see you soon.

    Kind Regards,

    (name)

    Subquestion; is it possible to reference the (name) to a cell in the spreadsheet I am sending?

    Help is much apriciated!

    Hond

    Moderator's Edit: Use code tags when posting code. To do so in future, select your code and click on the # icon at the top of your post window.
    Last edited by arlu1201; 12-14-2012 at 08:45 AM.

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