Results 1 to 10 of 10
  1. #1
    New Lounger
    Join Date
    Jun 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Legal Date Format (XP)

    We generate legal documents that contain dates in the form "this 11th day of May, 2001." We would like to be able to generate the "th" part of the date programmatically but haven't figured out how to do so. We can do the dates themselves with SAVEDATE field and a picture, but the part following the day of the month will be either "st," "nd," "rd" or "th" depending on the day of the month, and Word has no built-in function to do it. Ideally, the field should be capable of updating and changing depending on the actual value of SAVEDATE. Any ideas?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Legal Date Format (XP)

    Can I bill you? <img src=/S/wink.gif border=0 alt=wink width=15 height=15>

    I can do this with two separate fields, but I don't see any easy way to combine them into one. No matter, it's as easy to refresh two as one by using Ctrl+A (select all) and F9. I used DATE in these fields, since my document was unsaved, but the idea is the same:

    "this { DATE @ "d" *Ordinal * MERGEFORMAT } day of { DATE @ "day of MMMM, YYYY" * MERGEFORMAT }."

    As usual, you will need to use Ctrl+F9 to create the field braces if you do it manually, rather than through the Insert|Field... dialog.

    This was tested in Word 2000; your mileage may vary. For additional fun, search for field switch in the online help.

  3. #3
    New Lounger
    Join Date
    Jun 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Legal Date Format (XP)

    Works like a charm. Send me a bill indeed.

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Legal Date Format (XP)

    Hi Hilary:
    You can select everything that in Jefferson's post between the quotes & make it into an Autotext entry. You can even go into Tools/Customize & assign a shortcut key to that Autotext entry. Do I get to send a bill too? <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

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

    Re: Legal Date Format (XP)

    For a one-field answer, try:
    {QUOTE "this
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Legal Date Format (XP)

    Hi macropod:
    <img src=/S/clever.gif border=0 alt=clever width=15 height=15> & that's an excellent technique for combining multiple fields into one. Have to remember that one.

  7. #7
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    La Jolla, CA
    Posts
    1,470
    Thanks
    30
    Thanked 62 Times in 58 Posts

    Re: Legal Date Format (XP)

    Very nice! Now, how would you modify this to reference a date elsewhere? i.e., I don't think you can replace the DATE field with {REF mydate} where "mydate" is a bookmarked date entered by the user.

  8. #8
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    La Jolla, CA
    Posts
    1,470
    Thanks
    30
    Thanked 62 Times in 58 Posts

    Re: Legal Date Format (XP)

    replying to myself, I guess you could do this:

    On this {ref mydate @ "d" @Ordinal} day of {ref mydate @ "MMMM, YYYY"} you are ...

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

    Re: Legal Date Format (XP)

    For the most part yes, though I seem to get strange results if the "mydate" bookmark is a calculated date field.

    Also, watch the quote marks in the field - if you don't get them right the spaces disappear. Another thing that can be done is to use hard spaces (^s) in the field to force Word to keep whatever parts of the expression you want on the same line.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  10. #10
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Legal Date Format (XP)

    Depends on where and how you want to reference it. In my letterhead, the letter date is formatted in the Date style (which is the base style plus space before). I use a StyleRef field in my header to grab this date (so that if someone simply types a new date on page one of the letter, the headers on the continuation pages update automatically. This would work if you put your original date field in a table of some sort but not if it is in the middle of a paragraph.
    Charles Kyle Kenyon
    Madison, Wisconsin

Posting Permissions

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