+ Reply to Thread
Results 1 to 4 of 4

Spacing error with Email Macro

  1. #1
    Forum Contributor
    Join Date
    11-15-2008
    Location
    Arizona
    MS-Off Ver
    Excel 2013
    Posts
    181

    Spacing error with Email Macro

    The email macro I set up didn't work when I referenced the sendto from a cell in sheet 2; I changed it to reference an email address on sheet 1 and it worked with spacing errors.

    I need to fix the spacing errors, and I need to be able to pull the email from sheet 2.


    Code referencing sheet 2:

    Please Login or Register  to view this content.
    Code for email body, which has spacing errors:

    Please Login or Register  to view this content.
    Just to test the email I changed the line that was having troubles to reference sheet 1, and although it sent the email; the email had spacing errors.

    Here is the email it sent:

    Subject line: Students'points

    Body Line: Students' points in my class Harley Peterson45 Ratino Sherrod35


    I want it to send like this:

    Students points in my class

    Harley Peterson 45
    Ratino Sherrod 35

    etc....
    Last edited by dsrt16; 12-20-2009 at 03:40 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: Spacing error with Email Macro

    hello.

    When you are sending the message you are sending the message body as .htmlbody and as such any references to new lines should be in html code eg <br> or <p>.
    though if you want to use the vbnewline you should send the message body as plain text eg .body. hope that clears it up the spacing.

    cheers


  3. #3
    Forum Contributor
    Join Date
    11-15-2008
    Location
    Arizona
    MS-Off Ver
    Excel 2013
    Posts
    181

    Re: Spacing error with Email Macro

    Oh duh! Thanks I should have caught that; now I just need to figure out why it won't execute the code when the sndto is referencing sheet 2.

  4. #4
    Forum Contributor
    Join Date
    11-15-2008
    Location
    Arizona
    MS-Off Ver
    Excel 2013
    Posts
    181

    Re: Spacing error with Email Macro

    Oh that was a no duh too. I just named the sheet wrong; thanks! Small errors sometimes are easy to overlook.

+ 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