+ Reply to Thread
Results 1 to 5 of 5

Formatting text using VBA (put line breaks in a mailto hyperlink)

  1. #1
    Registered User
    Join Date
    08-25-2017
    Location
    Phoenix, AZ
    MS-Off Ver
    2013
    Posts
    74

    Formatting text using VBA (put line breaks in a mailto hyperlink)

    Hello and thank you in advance,

    I am using Office 2013 and I am not a programmer.

    I have this piece of text which I am pasting into the body of an email using this coding. I've bolded the part in question
    Please Login or Register  to view this content.
    I want to format the text so it looks like this:
    First Escalation:
    Step One - please either attach your original email to the gateway or open and forward that email
    Step Two - Add the waybill to the subject line above
    Step Three - delete this message and tell the gateway what you need
    Step Four - send your email!


    But it comes out looking like this:
    First Escalation:Step One - please either attach your original email to the gateway or open and forward that email
    Step Two - Add the waybill to the subject line above Step Three - delete this message and tell the gateway what you need
    Step Four - send your email!


    I tried using the above code but I don't know if I'm doing it right. I tried using Vbcr and Vbcrlf with no difference at all. What am I missing?

    Thanks again
    Last edited by 6StringJazzer; 12-08-2020 at 09:30 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Formatting text using VBA

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    I have made the change because of the short amount of text, but please review our rules for the future.

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Formatting text using VBA

    Non-ASCII characters are stripped out of a hyperlink. Try this, which I have formatted for easier readability but otherwise changed only VbCrLf:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-25-2017
    Location
    Phoenix, AZ
    MS-Off Ver
    2013
    Posts
    74

    Re: Formatting text using VBA

    Thank you 6StringJazzer,

    That makes sense to me. Thank you!

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Formatting text using VBA (put line breaks in a mailto hyperlink)

    You're welcome, and thanks for the rep!

+ 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. hyperlink a mailto with a table in the body text.
    By bennadelaidefringe in forum Excel General
    Replies: 0
    Last Post: 12-04-2015, 12:19 AM
  2. [SOLVED] Find & Edit Formatting of text in string that includes line breaks
    By Jennasis in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-07-2014, 11:50 AM
  3. Multi line email body from HYPERLINK CONCATENATE MAILTO?
    By JRR007 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-23-2012, 08:18 AM
  4. How to display text in a cell with a mailto concatenated hyperlink?
    By JRR007 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-22-2012, 11:18 AM
  5. Line Breaks In mailto
    By jamer02 in forum Excel General
    Replies: 1
    Last Post: 07-11-2011, 11:29 AM
  6. hyperlink mailto function, need to take body text from cell
    By kuraitori in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-12-2008, 05:35 PM
  7. Replies: 4
    Last Post: 07-18-2006, 01:05 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