• FILLIN UPDATES (2000)

    Author
    Topic
    #383667

    I’ve created a template document with FILLIN fields to prompt the user for info when creating a new doc. In options I have set on the Print tab – Update Fields checked (so that date and document name/path/ID are updated). The problem is that then the FILLIN fields prompt the user to answer the same questions again, or click cancel or something over and over.

    I’ve read the KB post (211597) and have added code in autonew to lock the fillin fields. Microsoft tells you to lock the fields by pressing CTRL F11… what does this do? Then, they tell you to add this code in autonew. (All of this seems to be addressing some problem that I don’t even have.) I added the third line, and it works well, except now the date and doc ID fields won’t update.

    Sub AutoNew()
    ActiveDocument.Fields.Locked = False
    ActiveDocument.Fields.Update
    ActiveDocument.Fields.Locked = True

    Is there anyway to lock specific fields in the document while leaving date and other document property fields unlocked?

    Thanks!

    Viewing 1 reply thread
    Author
    Replies
    • #654971

      Hi David,

      You might find that a macrobutton field will give a better result, if you use it thus:
      {MACROBUTTON NoMacro “Type something here”}
      This works by using the macrobutton field to solicit input instead of firing a macro (hence Nomacro) and, as soon as they do, the field is erased. Voila! No field left to update.

      Cheers

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • #655117

      Hi David:
      I agree with macropod. However, if you want to use FILLIN fields & have them prompt once, but have other fields update upon printing, you can do the following (which is a modification of the KB article & use of a macro provided by Dave Rado, MVP):
      1. In your template, lock your FILLIN fields only by selecting them & pressing Ctrl+F11.
      2. Use the following AutoNew macro in your fillin template:

      Sub AutoNew()
      
      Dim Fld As Field
      
      ActiveDocument.Fields.Locked = False
      ActiveDocument.Fields.Update
      
      For Each Fld In ActiveDocument.Fields
          If Fld.Type = wdFieldAsk Or Fld.Type = wdFieldFillIn Then
              Fld.Locked = True
          End If
      Next Fld
      End Sub

      You could also unlink, rather than unlock, the fillin fields if you wanted.

      Cheers,

      • #655656

        This worked perfectly! Thanks! (The macrobutton trick I am familiar with, but this document is very long and users would probably miss some fields and/or have to scroll all over the place to fill in the few items required.)

        • #655841

          Hi David,

          Here’s another solution, that doesn’t rely on a macro – which might be preferable to user’s getting macro warnings.

          1. In your template document, change each of the FILLIN fields to ASK fields in the following format:
          {QUOTE {IF{BkMrk} = “” {ASK BkMrk “Question”} “”}{BkMrk}}
          where BkMrk is a bookmark named to match the particular question that was previously asked in your FILLIN field.

          2. Then, at the start of each field, create a bookmark (ie Insert|Bookmark) corresponding to whatever you called BkMrk for that field.

          3. Save the template.

          Now, when the template is printed, users will only be prompted to update any ASK fields they haven’t answered.

          Cheers

          Cheers,
          Paul Edstein
          [Fmr MS MVP - Word]

          • #655863

            This is not working for me. I am inserting a field for each {} in your sample below with Ctrl F9. Do I need commas or something after the IF clause like Excel (IF 5 = A1, “yes”, “no”)?

            • #655880

              Hi David,

              Check out the attached example.

              In it, the 1st para has the suggested field, using “Answer1” (without quotes) as the bookmark. As you see, no commas are needed – this is a quirk of Word’s using IF in fields. If you select the para and press F9, you’ll get ASKed for a response. If you enter something, you won’t be ASKed again if the field is updated. If you don’t enter anything, you will get ASKed again if the field is updated.

              Cheers

              Cheers,
              Paul Edstein
              [Fmr MS MVP - Word]

            • #655897

              It’s working now (I had forgotten to add the autonew code to update fields) THANKS! David

          • #656206

            (Edited by Phil Rabichow on 24-Feb-03 15:12. to add the part below the ——–)

            THIS is an outstanding technique!! bravo The field can be saved as an autotext entry and placed wherever you would have used fillin fields in a template. Now we need a VBA expert to figure out a way to loop through such fields and change answer1 to answer2, answer3, etc. (and question1 to question2, etc.) and to add a corresponding bookmark at the beginning of the field. Perhaps nesting a SEQ field (just thinking out loud)…
            ———————-
            I’ve been playing with this some more & creating a series of autotexts without a macro is also a workable solution. You could define a series of autotext entries such as:

            T{QUOTE{IF{Answer1}= “” {ASK Answer1 “Question”} “”}{Answer1}} ,where T represents a bookmark

            Then just enter the autotext entries where you want the fillin fields. You have to leave at least one space before the bookmark field (can be zero width) in order to include it as part of the autotext definition.

            • #656268

              Thanks Phil,

              Automatic sequence numbering of the questions is easy enough by changing the field thus:
              {QUOTE{IF{“Answer{SEQ Answer#}”}= “” {ASK “Answer{SEQ Answer# c}” “Question”} “”}{“Answer{SEQ Answer# c}”}}
              Then you’d only need to create the matching sequential bookmarks – and re-word the question in each field to suit it’s intended purpose. I’m not inclined to tackle that through VBA as I think it’d be more work than it’s worth.

              Cheers

              Cheers,
              Paul Edstein
              [Fmr MS MVP - Word]

    Viewing 1 reply thread
    Reply To: FILLIN UPDATES (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: