protect variable from spell check?

G

Gil

I'd like to protect a patient's name from the spell checker. Patient's
name varies from document to document with each patient having a
personal single document file. Each patient's name appears multiple
times in the document.

Adding an ever-increasing number of patients' names to the custom
dictionary in an ongoing constantly updating fashion is unreasonable.

Is there a reasonable way to preclude spell checker from identifying
their names as misspellings? Perhaps I could automate copying the
patient's name into one of the document properties and any item in that
location would be protected from spell check? Using fields and/or
sections protected from spell check seems fraught with multiple
difficulties for many MS Word users.

Alternatively, an automated addition of patient's name to the custom
dictionary might work. … perhaps something like the following to add to
"myNames.dic" where code has previously selected the patient's name.

Dim tempNam as string
tempNam = Selection.Text
Set myNames.doc =_
Application.CustomDictionaries.ActiveCustomDictionary
Dim d 'Create a variable
Set d = CreateObject(Scripting.Dictionary)
' Object.Add Key, Item
d.Add "a", "Athens" 'Add some keys and items
d.Add "b", "Belgrade"
d.Add "c", "Cairo"
d.Add tempnam


or maybe something simpler?
"spell check but not check variable"
;)

tia,
Gil
http://www.TenSecondMedicalRecord.com
 
J

Jay Freedman

Assuming you have some base template with unchanging text, use a
document property (probably a custom one that you create in File >
Properties > Custom) to hold the name. Insert DocProperty fields in
the body of the template where the name should be repeated. Make a
character style that includes the Language > Do not check spelling
option, and apply that style to each DocProperty field.

Don't even think of adding names to the custom dictionary -- that way
lies madness!

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

Jezebel

1. Define a character style whose sole property is Language: 'Do not check
grammar or spelling'.

2. Apply that style to each instance of your patients' names. If the names
are always inserted by using a DocProperty field, you could use Find and
Replace: display field codes, then Find = ^d DocProperty
 
G

Gil

Thanks for your responses. Madness is my specialty <g>

Hmmmm. I wonder if I could use the style method/ Language/ Do not check
spelling, without using fields through the records. This
is for medical records and would need to be quite user friendly.

I'll play with it. :)

Hmmm, again, I now see Jez' addition.

Thanks. That looks like it should do it.

Cheers,
Gil
 

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