Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Austin
    Posts
    401
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Custom auto-date formats-Legalese (Word XP)

    Be it the known that on this <font color=red>xth day of January, 2005 </font color=red>
    this user did not have the slightest idea how to create a custom format that could deliver this data into a merge.

    Seriously, there always seems to be a lot of legal people here, so I was wondering if this had previously been addressed.
    I'm pretty certain it is needed.
    Thanks in advance

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Custom auto-date formats-Legalese (Word XP)

    For everything you ever wanted to know about formatting and manipulating dates in Word, have a look at Star<post#=249902>post 249902</post#>.

    StuartR

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

    Re: Custom auto-date formats-Legalese (Word XP)

    In addition to Stuart's reply: if you do a mail merge with a date field named, imaginatively, DateField, you can apply formatting switched to the merge field as follows:

    <code>{ MERGEFIELD DateField @ "d" * Ordinal } day of { MERGEFIELD DateField @ "MMMM, yyyy" }</code>

    Note: the { } are field brackets, you shouldn't type them yourself.
    Use the wizard or the mail merge toolbar to insert the date field.
    Right click it.
    Select Toggle Field Codes.
    Insert the formatting switches before the closing brackets.
    Press F9 to toggle field codes again and to update the result.

  4. #4
    4 Star Lounger
    Join Date
    May 2003
    Location
    Austin
    Posts
    401
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Custom auto-date formats-Legalese (Word XP)

    Thanks guys, this is all really great stuff.
    Is there any way I can build this outside of a merge function?
    I'd like to create a bookmark with it.
    My ultimate goal would be to get it into the insert DATE/TIME library, if possible.

    I'd trying to avoid returning this as a string from a user defined function in a stored procedure.

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

    Re: Custom auto-date formats-Legalese (Word XP)

    You could enter a date in the document, select it and create a bookmark, say MyDate. Or you can define the bookmark in an invisible field: { SET MyDate 3/21/2005 }. You can then refer to the bookmark as follows: { MyDate @ "d" * Ordinal } day of { MyDate @ "MMMM, yyyy" }. As before, don't type the field brackets { } yourself, use Insert | Field... or type Ctrl+F9 to create a field.

    You could create an AutoText entry from this.

  6. #6
    4 Star Lounger
    Join Date
    May 2003
    Location
    Austin
    Posts
    401
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Custom auto-date formats-Legalese (Word XP)

    Hans,
    I have followed your instructions but I keep getting an invalid bookmark type error message.
    First I hilighted an area with a date and created a bookmark (MyDAte)
    Then I insert a field and use the formula bar to enter <font color=red>MyDate @ "d" Ordinal day of My Date @ "MMMM,yyyy"</font color=red>
    After I return to the doc the field either says <font color=448800>"invalid end of field "</font color=448800> or <font color=448800>"Syntax Error,"</font color=448800>
    When I attempt to edit the formula, it crashes the app.

    1-If I strip out the {} field brackets, how can it distiguish the variables from the strings?
    2-I followed the field directions and it wants me to use "[" field brackets
    2- Do I leave the "=" sign in the formula or is this where the SET command went?

    Im sure it's something simple but it keeps evading me
    thanks for your help

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

    Re: Custom auto-date formats-Legalese (Word XP)

    The idea is like this:
    - Type Ctrl+F9 to insert field brackets { }
    - Between the brackets, type <code>MyDate @ "d" * Ordinal</code>
    - Press F9 to toggle the field code off and update the field
    - Click after the field, and type " day of " (without the quotes)
    - Type Ctrl+F9 to insert another pair of field brackets { }
    - Between the brackets, type <code>MyDate @ "MMMM, yyyy"</code>
    - Press F9 to toggle the field code off and update the field.

    I have attached a sample document. Warning: it was set up on a system with dd/mm/yyyy date format, so 12/1 was interpreted as the 12th of January.
    Attached Files Attached Files

Posting Permissions

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