Geekzone: technology news, blogs, forums
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.



752 posts

Ultimate Geek

#24588 28-Jul-2008 19:35
Send private message


I have been using some precidents (templates) in a .doc format.

They remind me of my youth, where I dabbled in some QBASIC stuff (very minor word games mostly). What I mean by this is, the precident will be say a paragraph of text, then in blue writing with italics it shows some options that seemingly you can choose.

For example:
On application
without notice, the Court made a temporary protection order against
[5=Respondent’s full name], the respondent on [6=date of order], which order is now final [7=in whole 
OR  in part]
[8=with modifications  OR  without modification].# ...

Then later in the text, if the respondent's full name is needed again, it is still used as the number 5 (instead of counting up like it seems the rest of the new fields do) leads me to believe there should be some sort of option in Word or otherwise where I can enter this information once in the text and have them all changed?

I have come across word doc's that ask you questions and fill out the form automatically (like that basic Qbasic stuff....) is that what I could get going?

Cheers for your help guys


Create new topic
3939 posts

Uber Geek

Lifetime subscriber

#152193 28-Jul-2008 20:52
Send private message

Hi Sam

A generic answer to your question is "yes".

Giving a very simplistic overview, there's 2 different ways you can go about this.  Both of them involve Visual Basic for Applications (VBA) - one to a much lesser degree than the other.

Option 1:
Create a form based on formfields

This option will use less code than going full blown VBA and will can be just, if not sometimes more, effective than a 'total' VBA approach, especially in forms that are not particularly complex.

From the basic piece of the (legal looking) form info you've posted I would recommend this as the way to go.

a. Create the document in Word.

b. Where Respondent's Full Name first needs entering add a Text formfield.  Call it Respondent1.  Wherever else it needs entering enter another Text formfield.  Call them Respondent2, Respondent3 etc.

c. Similar sort of thing for dates.

d. Have a drop down field for the location the form was completed (ie, Auckland, Christchurch, Dunedin, Hamilton, Wellington etc).

d. Protect the document as a form.

When your form layout is finished get into the VBA editor (press Alt+F11) - you'll need to write code to replicate data across the "duplicate" form fields (i.e. Respondent's Full Name) whenever they change (most easily achieved by setting the property of the initial field to "Run a Macro" when it is tabbed out of.

Fields which will receive "duplicate" information should be set so they can't be edited once document protection is turned on, other wise errant users might end up typing different names into different name fields!  (The VBA code will automatically unprotect and reprotect the document during the field replication process).

Option 2:
Go full blown VBA

Basically you'll design the form in Word but will have a space where the data goes instead of a formfield.  Into this space (again using the name as an example) you would insert a Bookmark and name it Respondent1.  Duplicate name spaces would be Respondent2 etc, just like above.

You'll also need to place a bookmark at the beginning of the next word on from the name so that you can have a dialogue box which allows you to quickly edit the original data.  Using two bookmarks allows for fast data retrieval.

It'll take more time to write the code as you'll need to develop a dialogue box first (after deciding what data the user needs to enter) for whatever data needs entering/editing.  Then you'll need to write the code to fill out your form from the entries in the dialogue box.


I hope I haven't confused you, I can knock stuff like this out reasonably quickly and haven't had a need to try and explain it before... I'm self taught so there may well be more efficient ways of doing this and much better ways of explaining it.  Other people will jump in pretty quick if there is! Smile

It isn't really complicated, but I've always found the key is in understanding how the form will be used and later edited.  Once you know that you know how complicated it's going to look and which approach will be best.  The next thing is getting your form (template) looking right.

The smarts behind it should be fairly rapid to implement with the right understanding/layout.

You'll find plenty of references on the 'net to help you out with writing VBA code, or you could look at hiring or buying a book on the subject.  I can help too but I'm several thousand kms away from you at the moment so my responses may be a lot slower than you'd like due to work commitments, time zones etc.

All the best

Create new topic

News and reviews »

Synology Introduces BeeStation
Posted 23-Feb-2024 14:14

New One UI 6.1 Update Brings Galaxy AI to More Galaxy Devices
Posted 23-Feb-2024 10:50

Amazon Echo Hub Available in New Zealand
Posted 23-Feb-2024 10:40

InternetNZ Releases Internet Insights 2023
Posted 20-Feb-2024 10:31

Seagate Adds 24TB IronWolf Pro Hard Drives for Multi-user Commercial and Enterprise RAID Storage Solutions
Posted 19-Feb-2024 16:54

Seagate Skyhawk AI 24TB Elevates Edge Security Capacity and Performance
Posted 9-Feb-2024 17:18

GoPro Releases Quik Desktop App for macOS and Introduces Premium+ Subscription Tier
Posted 9-Feb-2024 17:14

Ring Introduces New Ring Battery Video Doorbell Pro
Posted 9-Feb-2024 16:51

Galaxy AI Transforms the new Galaxy S24 Series
Posted 18-Jan-2024 07:00

D-Link launches AI-Powered Aquila Pro M30 Wi-Fi 6 Mesh Systems
Posted 17-Jan-2024 20:02

Newest LG 4K Lifestyle Projector Doubles as Art Objet
Posted 9-Jan-2024 15:50

More LG Smart TV Owners Set To Enjoy the Latest webOS Upgrade
Posted 9-Jan-2024 15:45

Panasonic Announces the Z95A and Z93A With Fire TV Built In
Posted 9-Jan-2024 15:30

Amazon Echo Pop Review
Posted 8-Jan-2024 14:22

Samsung Tab S9 FE Review
Posted 17-Dec-2023 08:26

Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.

Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.