+ Reply to Thread
Results 1 to 4 of 4

Email from Excel via VBA - Formatting problem

  1. #1
    Registered User
    Join Date
    05-23-2017
    Location
    BMS
    MS-Off Ver
    2007
    Posts
    7

    Email from Excel via VBA - Formatting problem

    I am using a macro in my spreadsheet that creates emails.
    When the email is created, the email body is inserted automatically from a cell in the spreadsheet.

    This cell contains the whole email phrasing with several paragraphs.
    In Excel the formatting is correct, but when taken over to the email the formatting gets messed up.
    The email body appears all in one paragraph without turnovers.

    (When copying the content of the cell manually there is no problem, so I do not think the text in the cell is the problem)

    Is there a way to keep the paragraphs the same?


    Thank you!

  2. #2
    Valued Forum Contributor
    Join Date
    12-01-2016
    Location
    Planet Earth
    MS-Off Ver
    95 - 2016
    Posts
    343

    Re: Email from Excel via VBA - Formatting problem

    Please be so kind and attach a sample Excel workbook.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.[/i]

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Email from Excel via VBA - Formatting problem

    Your cell text contains carriage returns or line feeds. Your email is probably in HTML format. Replace the line feeds with < br > for html formatting.

    Try something like this. Remove the spaces from "< br >". They were included for display in this thread.
    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    05-23-2017
    Location
    BMS
    MS-Off Ver
    2007
    Posts
    7

    Re: Email from Excel via VBA - Formatting problem

    Thank you

    <br> instead of spaces worked out well.

+ 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. Email via excel, width problem
    By mtcas in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-17-2017, 04:36 AM
  2. Problem with email macro excel
    By leozaffa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-20-2014, 06:11 PM
  3. excel to email problem
    By bhoon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-20-2014, 01:20 PM
  4. [SOLVED] Excel vba to create email - having a FROM (problem)
    By wrightyrx7 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-17-2014, 08:11 AM
  5. Email and Excel Problem
    By carl in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-22-2006, 03:50 PM
  6. [SOLVED] Formatting email and web addresses in Excel
    By JohnnyJomp in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 01-31-2006, 12:50 PM
  7. Sending email from Excel vba problem
    By PaulC in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-17-2005, 08:13 AM

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