Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Oct 2002
    Location
    Las Vegas, Nevada, USA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Display Yes No in custom doc property (2000)

    I have a Word template that I am populating from an Access database. I chose the Yes/No type in the custom doc properties and the field code has the following {DOCPROPERTY "Closed" *MERGEFORMAT} . Currently the display is Y and I would like Yes. I found the following code on MVP site, but I can't figure out where to put it. { IF { Mergefield YesNo } = "0" "No" "Yes" }
    Can anyone help?

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

    Re: Display Yes No in custom doc property (2000)

    I don't understand what the fact that you are populating your template from an Access database has to do with document properties. A document property "lives" in the document; it has no link to a field in an Access table or query. To have your custom document property display as Yes/No, you can create this nested field code at the place in the document where you want to display it:

    { IF { DOCPROPERTY "Closed" } ="N" "No" "Yes" }

    Remember, you mustn't type the brackets { } yourself; you can insert them by typing Ctrl+F9.

    If I misunderstood your question, please post back.

  3. #3
    New Lounger
    Join Date
    Oct 2002
    Location
    Las Vegas, Nevada, USA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Display Yes No in custom doc property (2000)

    I was following an example from Access Archon Column #44 (Merging to Word from Linked Access Tables). I've never done this before, so I could have everything messed up. What I want to do is populate a Word Template from my Access database so I can email the document instead of emailing an access report with the viewer software. I created the Word template, added the custom document properties for each field in my Access table so my fieldnames would show up when I inserted the Field Codes in the Word Template. When I initiate the code from Access, Word opens the template I created and populates all the Field Codes with my data. The Yes/No fields only display "Y".
    Thanks for your help.

  4. #4
    New Lounger
    Join Date
    Oct 2002
    Location
    Las Vegas, Nevada, USA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Display Yes No in custom doc property (2000)

    I got it to work. Thanks Hans. I was trying to use IIF and a comma between the Yes and No. I took them out and it works!

Posting Permissions

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