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


sxz



687 posts

Ultimate Geek


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

Hi,

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

sxz

Create new topic
3573 posts

Uber Geek

Trusted
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.

Note:
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
Steve


Create new topic



Twitter and LinkedIn »



Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

OPPO Find X2 Lite brings flagship features to mid-range 5G smartphone
Posted 29-May-2020 12:52


Sony introduces the digital camera ZV-1 for content creators
Posted 27-May-2020 12:47


Samsung Announces 2020 QLED TV Range
Posted 20-May-2020 16:29


D-Link A/NZ launches AI-Powered body temperature measuring system
Posted 20-May-2020 16:22


NortonLifeLock Online Banking Protection now available for New Zealand banks
Posted 20-May-2020 16:14


SD Express delivers new gigabyte speeds for SD memory cards
Posted 20-May-2020 15:00


D-Link A/NZ launches Nuclias cloud managed network solution hosted in Australia
Posted 11-May-2020 17:53


Logitech introduces new video streaming solution for home studios
Posted 11-May-2020 17:48


Next generation Volvo cars to be powered by Luminar LiDAR technology
Posted 7-May-2020 13:56


D-Link A/NZ launches Wi-Fi Certified EasyMesh system
Posted 7-May-2020 13:51


Spark teams up with Microsoft to bring Xbox All Access to New Zealand
Posted 7-May-2020 13:01


Microsoft plans to establish its first datacenter region in New Zealand
Posted 6-May-2020 11:35


Genesis School-gen has joined forces with Mind Lab Kids
Posted 1-May-2020 12:53


Malwarebytes expands into privacy with fast, frictionless VPN
Posted 30-Apr-2020 16:06


Kordia to donate TV airtime on Channel 200 to community groups
Posted 30-Apr-2020 16:00



Geekzone Live »

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


Support Geekzone »

Our community of supporters help make Geekzone possible. Click the button below to join them.

Support Geezone on PressPatron



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.

Alternatively, you can receive a daily email with Geekzone updates.