Word: Displaying warning messages when certain numbers are typed?

H

hessyhess

Here's an idea that's stumping me in Word 2003/2007. The idea is needed
for a busy clinical service.

We'd like to implement some sort of check that warns the user if a
potentially wrong number is entered. For instance, for something like a
patient's estimated total body volume, we'd like word to flash a warning
(or just highlight the word) if someone accidentally enters a low
number, like 50 mL.

Is there any way to do this, even if extra plugins are required? One
thought was to include something like "Total body water: 50" in the
dictionary, but then I'd have a million dictionary entries for all the
wrong numbers.

Another way is to run some sort of macro that goes to the required
areas (via bookmarks, perhaps) and checks the numbers, comparing them
with a certain range, and maybe highlighting the number in red if it's
suspicious. But will Word even let me design a macro to do that?

I know this is only my first post... If anyone has any ideas, please
let me know. Even links to potential third-party plugins would be
appreciated.:Bgr
 
J

Jay Freedman

If the document/template you're designing is a protected form using form
fields (http://www.word.mvps.org/FAQs/TblsFldsFms/LinesInForms.htm), or a
form designed to be completed by entering data in a userform
(http://www.word.mvps.org/FAQs/Userforms/CreateAUserForm.htm), then you
certainly can check the values. Read these articles:

http://www.word.mvps.org/FAQs/TblsFldsFms/ValidateFFields.htm
http://www.gmayor.com/formfieldmacros.htm

If you're thinking of having just an ordinary document with some bookmarks
in it -- don't do that. Bookmarks are easily overwritten or deleted, and
then the macro has no clue where to look for the data. You might get away
with an ordinary document containing tables, with the data entered in
specific cells, but unsophisticated users will quickly manage to make such
documents unusable.

A hint: Design your templates in the earliest version of Word the users will
work with. Later versions can handle those templates, but the reverse isn't
necessarily true -- you would have to know which features were introduced in
which version and avoid those that aren't available to some users.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Graham Mayor

I concur with Jay's suggestion, however in this instance I would stick with
his suggestion to use a userform to collect the data and assign it to
docvariables - reproducing the content of those variables in the document
with docvariable fields. You can then easily validate the user input for
values outside the required ranges (or you can offer values for the user to
pick from a list). For the basics, see Word MVP FAQ - Userforms
http://word.mvps.org/FAQs/Userforms.htm

for a more in depth explanation, see
http://gregmaxey.mvps.org/Create_and_employ_a_UserForm.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
H

hessyhess

Many thanks for the tips. I'll play around with this and choos
something that plays well with the clinic staff.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top