• Mixing ASK, Fillin and autonew

    • This topic has 4 replies, 3 voices, and was last updated 24 years ago.
    Author
    Topic
    #356001

    Hi
    Word 2000 SR1
    Hi Folks
    I need a template with a combination of ask, ref & fillin fields.
    I thought a macro named autonew would allow me to select whole doc and update the fields however I find

    On creating the new doc the fillin field prompts execute then the autonew kicks in and updates all fields including the fillins for a second time.

    What am I doing wrong ?

    Cheers
    Geof

    Viewing 1 reply thread
    Author
    Replies
    • #526236

      Hi Geof,

      You aren’t doing anything wrong, you’re just expecting rational behavior from Word!

      The FILLIN field updates automatically upon the creation of a new document. The ASK field requires the AutoNew macro. You can have it update all fields except the FILLIN fields, or you can use all ASK fields.

      Note also that any fields in headers/footers will not be updated by a general update all fields command. If you need code to update fields in headers/footers, write back.

      You may want to download the following from my download page (addbalance.com/word/download/) and take a look at them.
      AskForm and UserForm (These are both designed as tutorials with the VBA unlocked.)

      Hope this helps.

    • #526238

      Thanks for the ideas and the references ..

      I think I have got around the problem like this

      sub autonew
      For each field in activedocument.fields
      field.update
      next
      end sub

      If this doesnt work then back to userforms …

      Many thanks
      I find your sites very useful and appreciate the lounge immensely

      Geof

      • #526251

        Rather than a loop, you could try:
        activedocument.Fields.Update

        • #526454

          So long as none of the fields are in headers/footers (or textboxes) either of these will work.

    Viewing 1 reply thread
    Reply To: Mixing ASK, Fillin and autonew

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

    Your information: