Results 1 to 10 of 10
  1. #1
    Star Lounger
    Join Date
    Apr 2002
    Location
    Sydney, New South Wales, Australia
    Posts
    86
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Chr(13) in mailto: (excel97)

    The following generates an e-mail but I wanted to put a few carriage returns into the body of the message
    the Chr(13)'s are being ignored and all the text in the body is appearing in one line.


    Sub test()
    ActiveWorkbook.FollowHyperlink _
    "mailto:someone@somewhere.com?subject=Test mail&body=Dear Someone" & _
    Chr(13) & _
    Chr(13) & _
    "I wish this appeared on a new line"

    End Sub


    How do I put the two lines of text on different lines?

  2. #2
    Star Lounger
    Join Date
    Apr 2002
    Location
    Sydney, New South Wales, Australia
    Posts
    86
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Chr(13) in mailto: (excel97)

    after a lot of time of trying to work it out,
    I posted the question
    but then
    I found the answer
    .... so I get to answer my own post


    I just need to exchange Chr(13) with %_0_A (but with no underscores)

    Sub test()
    ActiveWorkbook.FollowHyperlink _
    "mailto:someone@somewhere.com?subject=Test mail&body=Dear Someone_%_0_A_%_0_A_Look! this is now on a new line"
    End Sub

    But you have to remove the underscore symbols.
    (I tired posting the answer it as it appears in the code that works in my excel file,
    but when I preview it, the three characters % 0 A were replaced by a carriage return
    wow it works even in the forum)

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Chr(13) in mailto: (excel97)

    % followed by a hexadecimal number is interpreted by HTML as a character code. You can post such codes in the Lounge by using <!t>[%]<!/t> instead of %, for example if you type <!t>[%]<!/t>0A, it becomes %0A when posted.

  4. #4
    Star Lounger
    Join Date
    Apr 2002
    Location
    Sydney, New South Wales, Australia
    Posts
    86
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Chr(13) in mailto: (excel97)

    Thanks for the info about the character codes

    Am I able to put another hyperlink into the message of the e-mail? I would like it to link to a file on the company's server
    The e-mail is being sent internally and everyone has the same drives mapped to the same drive letters.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Chr(13) in mailto: (excel97)

    You could include text of the form file:H:TestSomething.doc in the body. I don't know how to handle file names with spaces.

  6. #6
    Star Lounger
    Join Date
    Apr 2002
    Location
    Sydney, New South Wales, Australia
    Posts
    86
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Chr(13) in mailto: (excel97)

    Sub test()
    ActiveWorkbook.FollowHyperlink _
    "mailto:someone@somewhere.com?subject=Test Link&body=file:H:TestSomething.doc"
    End Sub

    Unfortunately the above code is only placing the text into the e-mail and not making it a link

    and the good news is that the files that I want to link to don't have spaces in their name

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Chr(13) in mailto: (excel97)

    On my system, the text is converted to a hyperlink, but then I'm using Outlook 2002. Which mail program are you using?

  8. #8
    Star Lounger
    Join Date
    Apr 2002
    Location
    Sydney, New South Wales, Australia
    Posts
    86
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Chr(13) in mailto: (excel97)

    Yes it is a problem with the version of outlook that we are using at work

    it works fine here at home where I have outlook2002, but everyone in the office uses outlook express (I think it's '97)

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Chr(13) in mailto: (excel97)

    I'm afraid I can't help you with that. Sorry.

  10. #10
    Star Lounger
    Join Date
    Apr 2002
    Location
    Sydney, New South Wales, Australia
    Posts
    86
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Chr(13) in mailto: (excel97)

    Thank you so much for all your help on this topic.

    Even though we can't apply the last bit to the older version of Outlook, I've been able to automate one more time-consuming task. There are quite a few people at work who are grateful for the help we get from the lounge.

    Now nobody is to tell the boss that we can all work quicker
    oh no here she comes
    "look busy!"
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> <img src=/S/compute.gif border=0 alt=compute width=40 height=20> <img src=/S/compute.gif border=0 alt=compute width=40 height=20> <img src=/S/compute.gif border=0 alt=compute width=40 height=20> <img src=/S/compute.gif border=0 alt=compute width=40 height=20> <img src=/S/compute.gif border=0 alt=compute width=40 height=20> <img src=/S/compute.gif border=0 alt=compute width=40 height=20> <img src=/S/compute.gif border=0 alt=compute width=40 height=20> <img src=/S/compute.gif border=0 alt=compute width=40 height=20> <img src=/S/compute.gif border=0 alt=compute width=40 height=20>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •