Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    Oct 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word Macro to Move Text to Multiple Form Fields (Word 97)

    I have created a form/template in Word to be used by therapists as a medical record. At the top of the form, Client Name and ID# are entered into form fields. Medical record standards say that the client name and id# have to be at the top of EVERY page of the record. So - I want to create a macro (on exit, I guess...) that will move the text that was just typed into a form field to multiple other fields in the same document.

    Is this possible? Anyone have any ideas?

    Thanks!

    Doug Bilski
    Richmond, VA

  2. #2
    Platinum Lounger
    Join Date
    Jan 2001
    Posts
    3,788
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Word Macro to Move Text to Multiple Form Field

    You can use bookmarks & the REF field to achieve this. For this plus other methods see <post#=409024>post 409024</post#>

  3. #3
    New Lounger
    Join Date
    Oct 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Macro to Move Text to Multiple Form Fields (Word 97)

    Thank you so much for the reference. I've read it through thoroughly and tried the suggestions. I just CANT get it to work! [img]/forums/images/smilies/sad.gif[/img]

    I'm not sure what I'm doing wrong! Here's where I'm at:

    I've created the form and saved it as a template. I created a text form field in the space where client ID will be entered. I've named that text form field "id". Now I'm stuck... I've tried right-clicking and dragging that field to the new spot. When I do that, I do get another form field to appear and the source is a very long LINK kind of message. Then, I protect the document for forms, save it, and then double-click on the file to open as a new un-named document (for testing purposes). When I type the text into that first form field (bookmarked "id") nothing happens in the linked field on the next page.

    Is it because of section breaks? - I'm using these because of the spell check limitations with form fields.
    Is it because of protecting for forms and doing that by section?

    I have the same problem with the other suggestion - Instead of dragging the field to the new location, I put my cursor there, hit ctrl-F9 and type "REF id" between the brackets. This results in the creation of field, but as above - no updating seems to happen.

    What am I missing?

    Thank you all SO much for the help!

    Doug

  4. #4
    Platinum Lounger
    Join Date
    Jan 2001
    Posts
    3,788
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Word Macro to Move Text to Multiple Form Field

    Fields do not normally update automatically. They normally update prior to printing or when a document is opened. You can force an update by using print preview or you can select the whole document (press Control+A) and then press F9.

    For another approach see WD97: How to Use Calculate on Exit in a Forms Document

  5. #5
    New Lounger
    Join Date
    Oct 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Macro to Move Text to Multiple Form Fields (Word 97)

    Tony,

    I understand now... thanks for the help. It was working all along (as you probably guessed), I just didn't see it. When I set it up again and did a print preview, I could see the the material had indeed carried over from the first text.

    This is VERY helpful to me, and I really thank you for the time you took in helping me!

    Thanks,

    Doug

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Macro to Move Text to Multiple Form Field

    Hi Doug:
    The method you mention in your previous post, right clicking & dragging, should give you a link that updates immediately (well, almost immediately). When you right click & drag the form field, you should have 3 choices. Pick the 3rd choice, Link Here. If you toggel field codes (Alt+F9), these links should look something like:

    { LINK Word.Document.8 "Document1" "OLE_LINK1" a r }

    The a switch should have it update immediately after you tab out of the form field. If not, can you post the template or document based on the template here.

    Added: Oh, for a macro to spellcheck protected forms, see http://www.mvps.org/word/FAQs/MacrosVBA/Sp...kProtectDoc.htm

  7. #7
    New Lounger
    Join Date
    Oct 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Macro to Move Text to Multiple Form Field

    Phil,

    Wow! Thanks for the link to the spell check solution - that's one has literally been haunting me for a year or more! Wish I had thought to post a question way back then! [img]/forums/images/smilies/smile.gif[/img]

    As for the click and drag method, are you sure it works in Word 97? I set up an incredibly simple document to test it out. I've attached it here in case you'd like to take a look at it. I couldn't get it to work even in this one page document... Sorry to be so slow!

    Here it is as a .doc since this board won't let me post it as a .dot.

    Thanks again!

    Doug
    Attached Files Attached Files

  8. #8
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Macro to Move Text to Multiple Form Field

    Hi Doug:
    I don't have Word 97 to test this, but it should work. As I recall, it even worked with Word 6 & 95. When I tested your document, the links didn't work, but that's because the path had changed (it was in my download folder). So I created two more links, changed the path in your two links, & now all 4 worked. You did protect the document for forms when you tested it, I assume. You also have to press the tab key when you're finished typing in the form field.

    I've attached your document, which I modified. To work, you'll have to press Alt+F9 & change the path, then press F9 (with the link selected) to update the field. Ocassionally, I've seen a few second delay in updating, but it really should work.
    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
  •