Results 1 to 9 of 9
  1. #1
    New Lounger
    Join Date
    Dec 2002
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do i create a wizard that fills out a form.... (Word 2000)

    How do i create a wizard that fills out a form i made by entering information. I don't know much about macros.

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

    Re: How do i create a wizard that fills out a form.... (Word 2000)

    Great post thanks Jefferson!
    I've been after a consolidated reference for exactly this topic for some time. Up till now, I've had only scrappy bits & pieces.
    This is a definite keeper.

    Alan

  3. #3
    Lounger
    Join Date
    Aug 2002
    Location
    Oklahoma City, Oklahoma, USA
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How do i create a wizard that fills out a form.... (Word 2000)

    Userforms ain't simple. Unless you really want to get into macros, the easiest way to do a simple form is with ASK fields and REF fields. Then do an autoopen macro as follows:
    Sub AutoOpen()
    ' Unprotect the doc - I always protect so people can't change my form
    ActiveDocument.Unprotect Password:="pw"
    'pw is just an example, of course
    'Ctrl A to select the whole doc
    Selection.WholeStory
    'F9 to update fields
    Selection.Fields.Update
    ' go back to the doc start
    Selection.HomeKey Unit:=wdStory
    ' protect the document again
    ActiveDocument.Protect wdAllowOnlyFormFields, NoReset:=True, Password:="pw"
    End Sub
    This isn't a "wizard" but it works. It is a little more snazzy than just having fields that say "Click here and type the Name". A userform to get variables from the user and then plug them in using bookmark fields is another way to go, but, as I say, it can get complicated. If you do want to get "into" vb, then you might as well dig in and learn userforms, otherwise, I wouldn't..

    You put an ASK in for each variable and a REF in for each place it goes in the doc,
    e.g. to get user input for the Dealer Name in a Dealer Agreement use this:
    {ASK Dealername "Type the Full Legal Name of the Dealer" d "Dealer Full Legal Name"}
    This prompts the user as shown. For more info read the ASK field help.
    Then, to plug the name in the preamble and signature block use:
    {REF Dealername} at each place you want the name obtained with the ASK field.
    For more info read the REF field help.
    There are other ways to do this and tons of information on the web about this subject. This is the SIMPLEST way I know to do what it looks like you want to do.

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

    Re: How do i create a wizard that fills out a form.... (Word 2000)

    Thanks for the code sample, but I am already very much "dug into VB" already <img src=/S/grin.gif border=0 alt=grin width=15 height=15> and have been working at the finer points of userforms and related dialogs for some time. The approach we've found to be most appreciated, at least by the clients I've been dealing with, is a userform that can be viewed at any time, and the whole of the data pesented for review/modification. This avoids the objections to having to fill in all the fields in one go (with an AutoOpen() or AutoNew() macro) and to have to delve through to change specific fields. It also shields the client from the need to learn about field codes at all - it's all done from one custom menu item or button "Review Data" or similar. This code can be autorun and/or available at any time for the client to run. Tooltips also provide lots of potential for detailed assistance to the user.

    Alan

  5. #5
    Lounger
    Join Date
    Aug 2002
    Location
    Oklahoma City, Oklahoma, USA
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How do i create a wizard that fills out a form.... (Word 2000)

    So, is there a distinction between a "Wizard" and a Word macro that loads a userform?

  6. #6
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: How do i create a wizard that fills out a form.... (Word 2000)

    A wizard is a particular example of a userform that can be loaded by a Macro. Some userforms are not Wizards.

    StuartR

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

    Re: How do i create a wizard that fills out a form.... (Word 2000)

    I'm not really sure of any strict definitions. I tend to think of a wizard as a series of userforms, sequentially connected by Previous & Next buttons (or similar). Conceptually, I don't see a great deal of difference between a wizard and one large userform. The value of a wizard IMO is to step the user logically through the information entry process, as well as (more) easily ensuring that certain data is correctly entered before further dependent data can be entered. Both single userforms and wizards will typically be launched by macros.

    Alan

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

    Re: How do i create a wizard that fills out a form.... (Word 2000)

    Hi Hubert
    I'm replying to your post http://www.wopr.com/cgi-bin/w3t/showflat.p...d&Number=212241, a copy of which I received in my mailbox, but which I don't seem to see here on the board:

    <center> <img src=/w3timages/blackline.gif width=33% height=2>
    So, are you actually doing a "Wizard" or are you doing a Word macro that loads a userform? I would be interested in knowing which you think is easier to design and which you think is easier for the user. I agree with you that users get very little or no Word training these days on anything, let alone fields, and they get intimidated fast if you do anything with fields that isn't fully automated and goof proof.
    <img src=/w3timages/blackline.gif width=33% height=2> </center>

    The points you raise have been the subject of many an "eventful" discussion <img src=/S/bif.gif border=0 alt=bif width=70 height=28> at my place of work. I tend to think that there are two schools of thought here among developers, depending on whether they come from a programming background or not. I do have a programming background, so my approach is to use VBA to the max, via a userform or wizard, to effectively shield the user from anything vaguely resembling code or structure, and to present them with a (pretty well) completed document after clicking the OK on the userform.

    The other school though, have grown up with Word's growing list of rich features that can be built into a document, but they tend to shy away from the mention of code. I feel that the drawback with this approach is that the user has to know nearly as much as the developer to take advantage of his/her innovations within a document. As you say, users get less and less training wrt the "workings" of Word these days.

    I may try to put up an example of the two approaches on the web somewhere. I'll post a link here (this thread) if I ever get the time to do it!

    Alan

  9. #9
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: How do i create a wizard that fills out a form.... (Word 2000)

    Edited by HansV to remove link that no longer worked

    The answer is about 50 pages long, but first, can you describe your form in more detail to see if there is an easier way?

    If you would like to read about creating a Wizard, which you do with a series of UserForms of your own design, see these references:

    Designing and Navigating Among UserForms:
    Microsoft Knowledge Base Article 212596 - WD2000: How to Create and Display a Custom Dialog Box
    Starts simple with a form that shows one text box and two buttons.
    How to create a Userform
    Another starter article, this one from the Word MVPs FAQ Site.
    Microsoft Knowledge Base Article 213747 - XL2000: How to Move Between Custom UserForms with Command Buttons
    Shows you how to go back and forth ("Next") between two UserForms.
    Chapter 11 - Add-ins, Templates, Wizards, and Libraries from the Visual Basic Programmer's Guide for Office 2000
    This article can be overwhelming, so use the browser's Find feature to search for the heading Creating Wizards, about 80% of the way down the page...

    Once your wizard collects information, it can either place it in Form Fields or at strategically marked points in your document, or can merge it with a prepared form. Useful parts of Word to be familiar with in doing this part of the design include: Bookmarks, Fields, the Forms toolbar, Document Properties, Mail Merge and AutoText. There have been many discussions of how best to get the data from one place to the next, and as we learn more about your application, the helpful people here will undoubtedly want to share their opinions and experiences with you.

Posting Permissions

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