Page 1 of 3 123 LastLast
Results 1 to 15 of 37

Thread: Forms (Word)

  1. #1
    New Lounger
    Join Date
    May 2003
    Location
    San Francisco, California, USA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Forms (Word)

    I am using Word to creat auto fill forms. There are places that I use the fill in request boxes. I would like to learn how to make the answer to one fill-box go into multiple places on a form. Help, please!!

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

    Re: Forms (Word)

    In general, the REF field can be used to refer to text somewhere else in a document.

    Are you using the Forms toolbar to create text boxes, dropdown list etc. to be filled in? Each formfield has a bookmark associated with it. You can see/modify the name of the bookmark by double clicking a formfield while the document is unprotected. You can refer to the text of the formfield in another location in the document by inserting a field of the form { REF bookmarkname }. There are several ways to insert a REF field:
    <UL><LI>Insert | Field...
    <LI>Insert | Cross Reference... (in Word 2002 Insert | Reference | Cross Reference...)
    <LI>Type Ctrl+F9 to insert field braces { }, then type REF followed by a space and the name of the bookmark.[/list]You should not type the field braces { } yourself. That won't work.

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

    Re: Forms (Word)

    Hi Danielle:
    The text form fields that you are using all have bookmark names. By default, they are Text1, Text2, etc.. You can right click a box while the form is unprotected & choose Properties. You will see the actual name of the bookmark assigned to the text form field.

    Wherever you want the same text to appear, you insert a REF field. When you're finished, protect the document for forms. The REF field has the syntax:

    { REF "BookmarkName" }

    where bookmarkname is the actual name (e.g. Text1, etc.). The curly brackets are NOT typed in, they are field braces & are inserted by pressing Ctrl+F9.

    Hope this helps.

  4. #4
    Lounger
    Join Date
    Jan 2003
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forms (Word)

    Phil and Hans:
    I followed your instructions (outlined in this thread) for creating the reference fields. It worked but I have a problem: the contents in the reference fields are visible only in print preview mode (and would show up in the actual printed document, I presume). The people who will be completing the form electronically will need to see that the reference field is complete while they are filling out the form. Otherwise, they will type right over the invisible field contents.

    One stange thing I noticed is that the referenced text field shows as a blank gray rectangle after the form is protected, but the reference fields, e.g, {REF text32}, don't show at all: no gray, no border to indicate a field is there.

    Can you help?

  5. #5
    Star Lounger
    Join Date
    Apr 2002
    Location
    Stone Ridge, New York, USA
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forms (Word)

    Double click on the formfield you have referenced and then check off "Calculate on Exit" in Text Form Field Options. That should do it. - Sherry

  6. #6
    Star Lounger
    Join Date
    Jun 2002
    Posts
    98
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Forms (Word)

    If you think it's worth the effort (lots of users, lots of usage of the template) here's my favorite recipe for form fill-in:

    1. Insert your FORM fields and REF fields in a template

    2. In VB Editor, design a UserForm for collecting all the necessary text fields to fill-in. You can also user checkboxes, drop-downs, default values, validation, etc...

    3. Add an "AutoNew" macro in the template -- this macro runs as soon as a user creates a new doc from the template.

    4. Have the macro display the UserForm to collect all the info to fill in and then use the results of the form to fill in the form fields in the doc.
    ActiveDocument.FormFields("Text1").Result =dlg.TextBox1

    5. Last step of the macro is to:
    Selection.WholeStory
    Selection.Fields.Update
    Selection.Fields.Unlink
    Selection.HomeKey Unit:=wdStory


    At the end of this process the user has a regular ol' document with no fields to accidentally "whack" or stumble over. It's all been converted to regular text.

    The userform and macro let me do a lot of extra work for the user in the background. Like major modifications to the doc depending on options the user selects. (I customize logos, the body text, signatures, etc.) And they like just filling in all the info in one little dialog instead of having to hop around in the doc filling one field at a time. I used this method to roll out a large number of templates to a national user base of 10,000 without having to train them. Hooray for that! It takes more coding on my end but is worth it for the daily users.
    __________________________________________________ ____
    <img src=/S/nun.gif border=0 alt=nun width=20 height=20> Sister Dory
    Our Lady of Perpetual Help, Holstein Falls, Wisconsin, USA

  7. #7
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Forms (Word)

    Dory,

    Thanks for sharing this 'recipe'.
    Can't resist tacking on a couple of tips:

    An alternative to inserting formfields in the document to act as the collection points for the information in the userform, is to just use bookmarks. Sometime these can provide more flexibility than formfields. Then the code in the userform could be like:

    ActiveDocument.Bookmarks("bmkName").Range.Text = dlg.TextBox1.Text

    Also, no need to select the entire document to do the fields update and unlink:

    With ActiveDocument.Fields
    .Update
    .Unlink
    End With

    Gary

  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: Forms (Word)

    Just to add something to Sherry's answer. The grey in the form field shading can be controlled by a button on the forms toolbar. The calculate on exit will update the REF field when you exit the text form field. However, in a protected document, users should not be able to type over the REF fields in any event. In a protected form, you are limited to making changes in any of the 3 types of form fields & in a non-protected section only.
    Cheers,

  9. #9
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forms (Word)

    I like your style Dory - it's the same approach I use myself <img src=/S/grin.gif border=0 alt=grin width=15 height=15>.

    Although I've also used the technique of unlinking the fields to "set the doc in concrete" so to speak, this restricts editing via the form once values have been committed. Another approach I've used is to use a show/hide button for the form on a toolbar. It's possible to then make changes to the data via the form. It's also possible to lock the fields in the doc, so that illicit changes can't be made directly in the document, but to unlock the fields when the UserForm is used for edits.

    The disadvantage here is that you don't get the "pure text" doc as the end result.

    Alan

  10. #10
    Star Lounger
    Join Date
    Jun 2002
    Posts
    98
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Forms (Word)

    You're reading me mind, 007!

    Since I usually operate in organizations where the IT staff has little to offer in the way of app development, I create a lot of applications-in-a-template for my clients. You can do just about anything with a Word (or Excel) Template. For re-entering data in a form that's already been filled, I'll store all the entered data in "document variables" that I can pull back into the UserForm if its opened again. Our police dept. uses a template like this to enter dictated reports, collecting data on each subject involved in a pseudo-database I built into a UserForm & docvars. One form had 5 "tabs" to fit all the data they could enter. I use a little function to validate dates -- screw up and it tells you "That's not a date" and shoves you back to the field. Calculates age based on bdate within the form.

    An insurance company used a Word template to quote long-term care insurance. The UserForm collects all the variables in dropdowns, radios & checkboxes then calculates the premium on the form, then dumps all the data into a nicely formatted doc. A toolbar button allows a re-quote. This took about 2 weeks to create in Word. The Delphi team estimated 6 months to add the feature to their main quoting program. Of course, Word gets no respect from the IT fellas -- it's sissy stuff. Not "serious" programming, you know. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    __________________________________________________ ____
    <img src=/S/nun.gif border=0 alt=nun width=20 height=20> Sister Dory
    Our Lady of Perpetual Help, Holstein Falls, Wisconsin, USA

  11. #11
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forms (Word)

    And who's reading who's mind now, eh Sister? <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    I was introduced to using docvars here in the lounge, by Jefferson I think, and find them an ideal way of doing exactly what you say. At the advice of the wise gurus here, I store formfield information in parsable (docvar) strings and these are easily disassembled into arrays, which can then be used to fill the form (and doc).

    I like the idea of the tabbed control for extensive information. I have used a similar approach, with multiple forms appearing as "wizards", which (sort of) ensure that certain (independent) information is entered before other (dependent) information. Again, somebody here in the lounge suggested exporting UserForm modules, then reimporting for each added step in the wizard - saves on code that is common to all the pages.

    Your date validation routine sounds similar to mine too (are you sure you're not copying?). I still use the same one I submitted as one of my first programming exercises, that validates dates back to the change from the Julian to the Gregorian calendar... still works after all this time too! I usually use it to appropriately fill the date dropdown lists though.

    Yep, VBA and the rich object models in MS Office, has a lot going for it. I've used Excel for solutions that have been similarly short on the cost and the development time, compared to standalones or "proper" programmed modules. BTW, I am also a qualified programmer, so I don't say this simply because I can't take the other routes. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    I'm having some difficulties using these methods though, with a pseudo-legal form at the moment. Problem is that if a question is not applicable, it should not appear on the doc at all. This is giving rise to some formatting problems. Also, if certain things are inapplicable, then a watermark saying "Not Official" should be printed - otherwise no watermark. I'm sure there will be a way through it though.

    always good to talk with a soul on the same wavelength <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    Alan

  12. #12
    Star Lounger
    Join Date
    Jun 2002
    Posts
    98
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Forms (Word)

    Alan:

    For "conditional text" in a form letter I usually store the text as an Autotext with the formatting already applied. After the user provides some input (usually picking a radio or checkbox in a UserForm) my code selects a bookmark or formfield in the right spot and inserts the Autotext. Just be sure to include that last parameter to AutotextEntries("YourAutoText").Insert to include the formatting.

    Just worked on one of these yesterday where the whole body text of a form letter was replaced based on which radio button a user selected. Three completely different form letters could be created from one template that way. Have you got a plan for the watermark? I've just used a text box stuck up into the header but positioned across the whole page. To insert it only when needed you can store the whole formatted -- bold yellow text looks good B&W -- text box as an AutoText and have your macro insert it into the header if needed. (Sorry if all this is obvious to you already.)
    __________________________________________________ ____
    <img src=/S/nun.gif border=0 alt=nun width=20 height=20> Sister Dory
    Our Lady of Perpetual Help, Holstein Falls, Wisconsin, USA

  13. #13
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forms (Word)

    Thanks again Dory. I use the same basic approach as yourself on this whole scenario it appears. I think I'll have to go autotext "all the way", as you appear to do, to get over some of the formatting problems I run into. Usually it's paragraph formatting from an autotext insert "taking over" the next paragraph of static document text, or something like that. It's more fiddly than anything else, but I might have better luck starting with a completely blank document.

    I'll give your watermark idea a shot. I had tried to use conditionally inserted external graphic files (Wordart style watermarks) but that is a bit too fiddly for various reasons. Bold yellow, eh? I'll see how it goes. BTW, is it easy to rotate such text in a textbox, so that it stretches diagonally across the page?

    cheers

    Alan

  14. #14
    Star Lounger
    Join Date
    Jun 2002
    Posts
    98
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Forms (Word)

    Textboxes don't rotate. You can use WordArt to get that effect. You just have to spend a bit of time getting rid of all the frou-frou shading and 3-D and skewy-stretchy stuff first -- unless your users fancy that sort of thing.

    Insert...Picture...WordArt. Pick something normal looking, then clean it up with the tools on the WordArt toolbar -- including the Rotate tool. Drag the WordArt handles to resize. Your masterpiece can be saved in an AutoText for future use.
    __________________________________________________ ____
    <img src=/S/nun.gif border=0 alt=nun width=20 height=20> Sister Dory
    Our Lady of Perpetual Help, Holstein Falls, Wisconsin, USA

  15. #15
    Lounger
    Join Date
    May 2003
    Location
    San Diego, California, USA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forms (Word)

    Dory, thanks for the information. I have been doing something similar but I use ASK fields to input the bookmarks using speech recognition.

    I thought about using a UserForm in the past, but never got it to work. I can't remember but I suspect I got stuck with the AutoNew Macro.

    I will give it another try and ask back when I get stuck <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Another of my to do projects is to write a macro to calculate age from DOB,

    I would love to see your code.

    Thanks

Page 1 of 3 123 LastLast

Posting Permissions

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