Results 1 to 6 of 6
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: no split over two lines (Win2000)

    It's called a non-breaking space, and its numeric code is 160, so you can insert it as Chr(160). If you have the phone number in a string variable VarName with a normal space in it, you can use
    VarName = Replace(VarName, " ", Chr(160))
    or something similar to obtain the phone number with a non-breaking space.

  2. #2
    New Lounger
    Join Date
    Jan 2004
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    no split over two lines (Word 2000)

    Hi all,
    I am trying to enter a phone number via a string at a bookmark. Easy, except that instead of a space in between the numbers, I want to add a soft space, so that the phone number will not be split over two lines. I think it's called a soft space - you get it when you type Ctrl Shift Space at the same time.
    Baisically, instead of seeing:
    this is a sentence that takes the phone number up to the end of the line, and our phone number is: 1234
    5678
    It looks like this:
    this is a sentence that takes the phone number up to the end of the line, and our phone number is:
    1234 5678
    Can anyone tell me what the character code is for this? Or some other way of doing it?

    Thanks
    JB

  3. #3
    New Lounger
    Join Date
    Jan 2004
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: no split over two lines (Win2000)

    Hans,

    you are a star! Thankyou very much!

    Cheers
    JB

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

    Re: no split over two lines (Win2000)

    You're welcome.

    For the future: there is a (relatively) easy way to find the numeric code for this and other characters:
    - Type the character in a document (in this case by pressing Ctrl+Shift+Space)
    - Select the character you just typed.
    - Activate the Visual Basic Editor (Alt+F11)
    - Activate the Immediate window (Ctrl+G)
    - Type ? Asc(Selection) and press Enter.
    The ASCII/ANSI code for the first character in the selection will be displayed.

  5. #5
    New Lounger
    Join Date
    Jan 2004
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: no split over two lines (Win2000)

    Thanks again, Hans. I'll have to remember that one!

    Cheers
    JB

  6. #6
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: no split over two lines (Win2000)

    Better use AscW(Selection). It returns Unicode, and works for all characters, not just those in the old Windows code page.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

Posting Permissions

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