Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Apr 2002
    Location
    Stone Ridge, New York, USA
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Phone Number Formfield Text Format (Word 2000)

    Hi, How would I set a custom text format in a formfield. For instance, set it to (xxx) xxx-xxxx so that anytime 10 numbers were typed into the formfield it would automatically format as above (phone number). Like you can set various Date formats, Time formats, etc. I also need to set one for xxxx-xxxxx-xxxx.

    Thanks,
    Sherry

  2. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Phone Number Formfield Text Format (Word 2000)

    Hi Sherry,

    You could try a field with something like:
    {QUOTE{ASK Phone "What is the 10-digit phone No.? Please enter digits only (eg: 1234567890)."}{Phone # (000)-0000-000}}

    This uses an ASK field to solicit the phone #, then formats the answer as (123) 4567 890 (ie without hyphens).

    If the user tries to enter the number with hyphens, Word interprets them as minus signs and does math on the number when you try to re-format it! The same happens if a 'helpful' user tries to enter a correctly formatted number. You could overcome both issues by using IF to test whether "Phone" was less than (say) 1000000, but even then 'strange' number formats won't be trapped and you'll be stuck with the format entered by the user. The only way I can see to deal with all of these issues is to add a MACROBUTTON field to fire a macro that can do the processing that a Word field can't do on its own.

    Hope this helps
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Posting Permissions

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