+ Reply to Thread
Results 1 to 6 of 6

Keeping Line Breaks from inside cells when exporting data to outlook

  1. #1
    Registered User
    Join Date
    06-23-2014
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    3

    Keeping Line Breaks from inside cells when exporting data to outlook

    Hi Everyone,

    I'm trying to generate an email out of my spreadsheet and use cell values to populate the email.

    The issue I'm having is once of the cells (D17) has multiple lines in it, created by using Alt + Enter; and this formatting doesn't appear in the html body of the email.

    Code is:

    Please Login or Register  to view this content.
    Is there any way around this?

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Keeping Line Breaks from inside cells when exporting data to outlook

    Try replacing Chr(10) with "<br><br>".
    [code]
    sMsgBody = sMsgBody & Replace(Cells("17", "D").Value, Chr(10), "<br><br>") & "<br><br>"
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    09-17-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Keeping Line Breaks from inside cells when exporting data to outlook

    Try this:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-23-2014
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    3

    Re: Keeping Line Breaks from inside cells when exporting data to outlook

    Thanks I'll try that

  5. #5
    Registered User
    Join Date
    09-17-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Keeping Line Breaks from inside cells when exporting data to outlook

    You can keep all these line breaks by using given code. What else is missing.

  6. #6
    Registered User
    Join Date
    06-23-2014
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    3

    Re: Keeping Line Breaks from inside cells when exporting data to outlook

    That worked Thanks for that

+ 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. Add line breaks and signature to Outlook email
    By kirtchristensen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-31-2011, 07:29 PM
  2. Exporting data from outlook
    By marcfields in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 03-18-2010, 06:49 AM
  3. [SOLVED] exporting .csv data to Outlook
    By baltobernie in forum Excel General
    Replies: 1
    Last Post: 02-04-2006, 04:25 PM
  4. Exporting data to outlook?
    By Stevehud99 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 08-20-2005, 01:54 PM
  5. line breaks in formatted cells
    By johng in forum Excel General
    Replies: 0
    Last Post: 01-06-2005, 04:27 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