+ Reply to Thread
Results 1 to 8 of 8

Add spacing in front of HTML body

  1. #1
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Add spacing in front of HTML body

    Hi All,

    I have a line of code that I use to send an email using excel. Is there a code I can add to the front of one of the sentences I have the VBA code create?

    Currently my sentence in the body of the email looks like this:

    "Please advise if I may allocate/move the below items.


    Div. 1 - Items highlighted in red are do not request.
    Items highlighted in green are B only."


    I would like it to be:

    "Please advise if I may allocate/move the below items.


    Div. 1 - Items highlighted in red are do not request.
    Items highlighted in green are B only."


    I tried to add my code but either this site, or my office will not let me post HTML.

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Add spacing in front of HTML body

    Hi,

    I can't see any difference between the two texts? Could you perhaps put the HTML into a text file and attach that?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Re: Add spacing in front of HTML body

    Sorry for the delay. I hadn't realized you responded. Attached is a txt file that contains my
    code. Below shows how I would like the result to look.

    Please advise if I may allocate/move the below items.

    Division 1 - Items highlighted red are do not request.
    ---Space---Items highlighted green are BBB only.

    I couldn't line them up exactly in the example above, but the word "Items" on each line should align with each other.
    Attached Files Attached Files
    Last edited by Teblol; 07-12-2017 at 11:21 AM.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Add spacing in front of HTML body

    Hello Teblol,

    In HTML you can align the text using a Table. The updated code is in the attached text file. For some reason, the forum will let me post the answer with HTML code included.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Re: Add spacing in front of HTML body

    Hi Leith,

    Thanks for your Reply! Can we only format spaces using a table in HTML? Your solution works perfectly, I am only asking out of curiosity.

    If you are able to post the HTML code as a reply then it must be something on my end.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Add spacing in front of HTML body

    Hello Teblol,

    The contents cell or Table Data (TD) can be formatted many ways. Using spaces exclusively to line up your text is not a good method. If your font is not a proportionate font like Courier then the kerning will offset the characters and they will be misaligned. Since there is no way to repeat a space other than by repeating it in the text, it is not very practical.

  7. #7
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Re: Add spacing in front of HTML body

    Great. Thank you very much for the info. I have marked the thread as solved.

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Add spacing in front of HTML body

    Hello Teblol,

    You're welcome.

    If you are not familiar with HTML and want to learn more, visit this site. It is a great resource.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Emailing with HTML Body
    By cheeze83 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-07-2019, 02:01 AM
  2. HTML body in email
    By ash2017 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-11-2017, 09:37 AM
  3. Manipulating Email HTML for Spacing Before and After VIA Macro
    By Robert_B in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-05-2015, 01:11 PM
  4. [SOLVED] Vba to draft html body in outlook
    By arun.sj in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 07-15-2015, 07:37 AM
  5. Edit email html body
    By kmakjop in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-22-2015, 09:43 PM
  6. Excel ws into outlook html body with current html signature
    By Cadelanne in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2014, 09:03 AM
  7. Front Page- Excel To Html Printing
    By Liane in forum Excel General
    Replies: 0
    Last Post: 07-19-2006, 05:31 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