Results 1 to 8 of 8
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts
    My document has a custom document property that tells me the number of Trustees. If that value is 1, I want to use the word Trustee. If more than 1, then Trustees.

    I also need to form the possessive of Trustee and Trustees.

    {If {DocProperty TRCount} = 1, Trustee's, Trustees' }

    This works well, except for the fact that the apostrophe is a 'straight' apostrophe, and we use curly (smart) quotes in our documents.

    I imagine I need a field for the True and False values, and this field would include ASCII 146 where the apostrophe is required.

    I'm stumped as to how to create this compound field. I would appreciate any help.

    Thanks,
    Richard

  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
    Quote Originally Posted by richardbarrett View Post
    {If {DocProperty TRCount} = 1, Trustee's, Trustees' }

    This works well, except for the fact that the apostrophe is a 'straight' apostrophe, and we use curly (smart) quotes in our documents.
    You can paste in the desired text for the True and False results with the special characters you require. You also can use another IF field for either of those results to account for multiple scenarios. I don't recall the maximum depth of field nesting, but it's deep enough for most purposes. (But do you use commas between the 3 parts? I think you omit those and "quote" your true and false strings.)

  3. #3
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts
    You're right.. no commas. I added them when I wrote my fake code. And quotes are necessary only if there are spaces in the true/false values.

    Thanks for your help.

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

    For the single/plural form, you could use a field coded as:
    {={DOCPROPERTY TRCount }-1 \# "Trustees;;Trustee"}
    or:
    Trustee{={DOCPROPERTY TRCount }-1 \# "s;;"}

    For the possesive single/plural form, you could use a field coded as:
    {={DOCPROPERTY TRCount }-1 \# "Trustees'';;Trustee''s"}
    or:
    Trustee{={DOCPROPERTY TRCount }-1 \# "s'';;''s"}
    (Note the use of the smart quote between each pair of straight quotes).
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  5. #5
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts
    Thanks, Paul.

    As suggested previously, I add the smart quote to the field by pasting. (No need to indicate an ASCII character.)

    Is there any danger that the curly apostrophe will revert to a staight apostrophe? That's our main worry.

    Richard

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by richardbarrett View Post
    Is there any danger that the curly apostrophe will revert to a staight apostrophe? That's our main worry.
    I don't think so. Unlike AutoFormat as You Type's option to change normal marks into "smart" marks, there is no option to change them back. However, if someone were to run a global Find and Replace in the document, they might be able to change it that way.

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

    Other than via Find/Replace, no, and even that you could guard against with:
    {={DOCPROPERTY TRCount}-1 \# "Trustees'{DOCPROPERTY Apostrophe}';;Trustee'{DOCPROPERTY Apostrophe}'s"}
    where the 'Apostrophe' document property contains just the smart apostrophe. Although a Find/Replace op could change the displayed character, it would revert to the smart form immediately the field is updated (eg via Print Preview).
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  8. #8
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts
    Thanks. I set the values of the custom doc properties with code, and I can easily have a separate doc property for the possessive form of Trustee. I have a doc property for the possessive pronoun (his/her/its/their) that refers to Trustee/s, so this follows. Users would never go near the doc properties; they edit data by means of a dialog box, and my code sets values from there.

    Thanks again.
    Richard

Posting Permissions

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