Finding/Changing Select Text: Technique?

D

djprius

I have a Trust document in which the trustee is sometimes a man,
sometimes a woman, and sometimes multiple persons. I need to be able to
efficiently find and change things like the following:

1. If there are "trustee" (plural), the expression "the trustee
is" in the form needs to be changed to "the trustees are" [I can use
search and replace for changing the singular to the plural, but changing
"is" to "are" cannot be handled efficiently this way because "is" might
be used 150 times in the document and only need changing in only 4 or 5
instances);

2. If the trustee is a woman, the expression might be "the
trustee in HER discretion", but if a man, it would be "the trustee in
HIS discretion".

The main factor is *finding* the text; it would be a bonus to have an
easy way to change it, but there are usually only 5-10 places that need
changing so that manually changing them is not a major issue.

I've been considering using hidden text at the spots in the text that
might need changing or using bookmarks. Are these workable ideas?
Which would be a better technique? Maybe there's another way entirely
separate that should be used.

I'd appreciate any suggestions that people with experience have on
this issue.

Thanks.

David
 
G

Greg Maxey

David,

You might use a DropDown to identify the trustee/s. You could put the
following entries in the dropdown

Trustee (Male)
Trustee (Female)
Trustees

and then run code something like this to set the value in the dropdown
and other text fields:

Sub OnExit()
Dim oFF As FormFields
Set oFF = ActiveDocument.FormFields
Select Case oFF("DropDown1").DropDown.Value
Case Is = 1
oFF("Text1").Result = "His"
oFF("Text2").Result = "the Trustee is"
Case Is = 2
oFF("Text1").Result = "Her"
oFF("Text2").Result = "the Trustee is"
Case Is = 3
oFF("Text1").Result = "Their"
oFF("Text2").Result = "the Trustees are"
End Select
End Sub

Note this will result in a fourth entry in the dropdown (Trustee)
which hopefully you can just ignore.
 
S

Suzanne S. Barnhill

What you might want to consider is this: Instead of having a document with a
single male trustee, have a document in which you must select the
appropriate form, which will then be propagated throughout the document. The
DataPrompter add-in from Bill Coan will allow you to add a UserForm that
basically asks the question, "Male, female, or plural?" and then fills in
the appropriate terms at the places you designate in the document. See
http://www.wordsite.com/products/dpdas.htm and
http://www.wordsite.com/products/dpdas_features.htm.
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Greg Maxey

You could run this code on entry to the dropdown so it only displays
the three choices:

Sub OnEntry()
Dim oFF As FormFields
Set oFF = ActiveDocument.FormFields
With oFF("DropDown1").DropDown
.ListEntries(1).Name = "Trustee (Male)"
.ListEntries(2).Name = "Trustee (Female)"
.ListEntries(3).Name = "Trustees"
On Error Resume Next
.ListEntries(4).Delete
On Error GoTo 0
End With
End Sub
 
S

Summer

If you don't want to purchase a program (of which there are many) or program
it yourself as per Greg's assistance then create 3 separate documents
templates.
 
J

Jay Freedman

Here's a better technique:

In the File > Properties dialog, on the Custom tab, define custom
properties with Text type. The names can be whatever you like, but
I'll suggest Trustee, Verb, Pronoun, and Possessive. Assign them
values like this:

Trustee = trustee
Verb = is
Pronoun = he
Possessive = his

If your base is a document (.doc), save it as a template (.dot). In
the boilerplate, replace each occurrence of "trustee" by a field with
the code

{ DocProperty Trustee }

The field, when updated, will show the value you assigned to the
document property.

Also replace each occurrence of "is" that would be affected by the
number of trustees by a field with the code

{ DocProperty Verb }

Similarly, replace "he" with { DocProperty Pronoun } and replace "his"
with { DocProperty Possessive }.

Whenever you start a new trust document, do it by basing it on the
template; then go to File > Properties for that document and change
the document properties' values if necessary:

Trustee = trustee
Verb = is
Pronoun = she
Possessive = her

or

Trustee = trustees
Verb = are
Pronoun = they
Possessive = their

Finally, select the whole document and press F9 (or go to Print
Preview and back) to update the fields.

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

djprius

Greg,
Since I'm brand new to Word (July 07), I'm not up to implementing what
you propose (yet). The suggestion by Jay Freedman is one that seems
easiest for me to implement. Thank you for your help.

David

**************************************

Greg said:
David,

You might use a DropDown to identify the trustee/s. You could put the
following entries in the dropdown

Trustee (Male)
Trustee (Female)
Trustees

and then run code something like this to set the value in the dropdown
and other text fields:

Sub OnExit()
Dim oFF As FormFields
Set oFF = ActiveDocument.FormFields
Select Case oFF("DropDown1").DropDown.Value
Case Is = 1
oFF("Text1").Result = "His"
oFF("Text2").Result = "the Trustee is"
Case Is = 2
oFF("Text1").Result = "Her"
oFF("Text2").Result = "the Trustee is"
Case Is = 3
oFF("Text1").Result = "Their"
oFF("Text2").Result = "the Trustees are"
End Select
End Sub

Note this will result in a fourth entry in the dropdown (Trustee)
which hopefully you can just ignore.


I have a Trust document in which the trustee is sometimes a man,
sometimes a woman, and sometimes multiple persons. I need to be able to
efficiently find and change things like the following:

1. If there are "trustee" (plural), the expression "the trustee
is" in the form needs to be changed to "the trustees are" [I can use
search and replace for changing the singular to the plural, but changing
"is" to "are" cannot be handled efficiently this way because "is" might
be used 150 times in the document and only need changing in only 4 or 5
instances);

2. If the trustee is a woman, the expression might be "the
trustee in HER discretion", but if a man, it would be "the trustee in
HIS discretion".

The main factor is *finding* the text; it would be a bonus to have an
easy way to change it, but there are usually only 5-10 places that need
changing so that manually changing them is not a major issue.

I've been considering using hidden text at the spots in the text that
might need changing or using bookmarks. Are these workable ideas?
Which would be a better technique? Maybe there's another way entirely
separate that should be used.

I'd appreciate any suggestions that people with experience have on
this issue.

Thanks.

David
 
D

djprius

Suzanne said:
What you might want to consider is this: Instead of having a document with a
single male trustee, have a document in which you must select the
appropriate form, which will then be propagated throughout the document. The
DataPrompter add-in from Bill Coan will allow you to add a UserForm that
basically asks the question, "Male, female, or plural?" and then fills in
the appropriate terms at the places you designate in the document. See
http://www.wordsite.com/products/dpdas.htm and
http://www.wordsite.com/products/dpdas_features.htm.

Susanne,

Thank you for the reference. I don't think I want to learn a new
program right now since I'm just learning Word (having used WordPerfect
since 1986!) My need for the coding is likely only 10-15 times a year
-- so the investment in learning and setup is likely to great. (I have
used the program HotDocs in the past; this sounds like it may be
similar). But thanks.

David
 
D

djprius

Summer,

Using separate templates doesn't work because the basic form will
likely be changed each: it is a starting point only and must be
customized. To further complicate the matter, they are often done in
pairs, one for each spouse.

As noted in my response to another poster, I have used HotDocs, the
leading program, I think, in the past. That program didn't work that
well for me since most of the documents are heavily customized.

Thanks for your response.

David

*******************************************

If you don't want to purchase a program (of which there are many) or program
it yourself as per Greg's assistance then create 3 separate documents
templates.

djprius said:
I have a Trust document in which the trustee is sometimes a man,
sometimes a woman, and sometimes multiple persons. I need to be able to
efficiently find and change things like the following:

1. If there are "trustee" (plural), the expression "the trustee is"
in the form needs to be changed to "the trustees are" [I can use search
and replace for changing the singular to the plural, but changing "is" to
"are" cannot be handled efficiently this way because "is" might be used
150 times in the document and only need changing in only 4 or 5
instances);

2. If the trustee is a woman, the expression might be "the trustee
in HER discretion", but if a man, it would be "the trustee in HIS
discretion".

The main factor is *finding* the text; it would be a bonus to have an
easy way to change it, but there are usually only 5-10 places that need
changing so that manually changing them is not a major issue.

I've been considering using hidden text at the spots in the text that
might need changing or using bookmarks. Are these workable ideas? Which
would be a better technique? Maybe there's another way entirely separate
that should be used.

I'd appreciate any suggestions that people with experience have on this
issue.

Thanks.

David
 
D

djprius

Jay,

I think your suggestion sounds like it fits the bill perfectly -- and
is one that I as a novice Word user can implement.

I'll let you know if I'm successful. Thanks.

David

***********************************************

Jay said:
Here's a better technique:

In the File > Properties dialog, on the Custom tab, define custom
properties with Text type. The names can be whatever you like, but
I'll suggest Trustee, Verb, Pronoun, and Possessive. Assign them
values like this:

Trustee = trustee
Verb = is
Pronoun = he
Possessive = his

If your base is a document (.doc), save it as a template (.dot). In
the boilerplate, replace each occurrence of "trustee" by a field with
the code

{ DocProperty Trustee }

The field, when updated, will show the value you assigned to the
document property.

Also replace each occurrence of "is" that would be affected by the
number of trustees by a field with the code

{ DocProperty Verb }

Similarly, replace "he" with { DocProperty Pronoun } and replace "his"
with { DocProperty Possessive }.

Whenever you start a new trust document, do it by basing it on the
template; then go to File > Properties for that document and change
the document properties' values if necessary:

Trustee = trustee
Verb = is
Pronoun = she
Possessive = her

or

Trustee = trustees
Verb = are
Pronoun = they
Possessive = their

Finally, select the whole document and press F9 (or go to Print
Preview and back) to update the fields.

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

I have a Trust document in which the trustee is sometimes a man,
sometimes a woman, and sometimes multiple persons. I need to be able to
efficiently find and change things like the following:

1. If there are "trustee" (plural), the expression "the trustee
is" in the form needs to be changed to "the trustees are" [I can use
search and replace for changing the singular to the plural, but changing
"is" to "are" cannot be handled efficiently this way because "is" might
be used 150 times in the document and only need changing in only 4 or 5
instances);

2. If the trustee is a woman, the expression might be "the
trustee in HER discretion", but if a man, it would be "the trustee in
HIS discretion".

The main factor is *finding* the text; it would be a bonus to have an
easy way to change it, but there are usually only 5-10 places that need
changing so that manually changing them is not a major issue.

I've been considering using hidden text at the spots in the text that
might need changing or using bookmarks. Are these workable ideas?
Which would be a better technique? Maybe there's another way entirely
separate that should be used.

I'd appreciate any suggestions that people with experience have on
this issue.

Thanks.

David
 
S

Suzanne S. Barnhill

FWIW, it's not a new program; it's an add-in to Word that uses DocProperties
(and DocVariables) in much the same way Jay describes. It just automates
creating a UserForm to collect the data to write to those properties so you
don't have to do it manually.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
D

djprius

Jay,

Your solution was perfectly tailored for my need, a truly elegant way
to handle my usage. Thank you again.

I found something that surprised me: I can enter the DocProperty
field codes on Word 2007 through Insert|Quick Parts|Field, but I cannot
successfully use the manual method (Ctrl+F9 to get the field code
markers and then manually insert the DocProperty field code and
parameter). I tried this on two computers that have Word 2007 without
success. I used the exact same syntax -- including spacing and
capitalization -- as the Insert, etc. method and it didn't work. I then
varied spacing (by leaving out the leading space and trailing space);
one day that worked on one computer, but today even that didn't work.
On the second computer, I never got the manual method to work. Puzzling
to me.

David

************************************************

Jay said:
Here's a better technique:

In the File > Properties dialog, on the Custom tab, define custom
properties with Text type. The names can be whatever you like, but
I'll suggest Trustee, Verb, Pronoun, and Possessive. Assign them
values like this:

Trustee = trustee
Verb = is
Pronoun = he
Possessive = his

If your base is a document (.doc), save it as a template (.dot). In
the boilerplate, replace each occurrence of "trustee" by a field with
the code

{ DocProperty Trustee }

The field, when updated, will show the value you assigned to the
document property.

Also replace each occurrence of "is" that would be affected by the
number of trustees by a field with the code

{ DocProperty Verb }

Similarly, replace "he" with { DocProperty Pronoun } and replace "his"
with { DocProperty Possessive }.

Whenever you start a new trust document, do it by basing it on the
template; then go to File > Properties for that document and change
the document properties' values if necessary:

Trustee = trustee
Verb = is
Pronoun = she
Possessive = her

or

Trustee = trustees
Verb = are
Pronoun = they
Possessive = their

Finally, select the whole document and press F9 (or go to Print
Preview and back) to update the fields.

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

I have a Trust document in which the trustee is sometimes a man,
sometimes a woman, and sometimes multiple persons. I need to be able to
efficiently find and change things like the following:

1. If there are "trustee" (plural), the expression "the trustee
is" in the form needs to be changed to "the trustees are" [I can use
search and replace for changing the singular to the plural, but changing
"is" to "are" cannot be handled efficiently this way because "is" might
be used 150 times in the document and only need changing in only 4 or 5
instances);

2. If the trustee is a woman, the expression might be "the
trustee in HER discretion", but if a man, it would be "the trustee in
HIS discretion".

The main factor is *finding* the text; it would be a bonus to have an
easy way to change it, but there are usually only 5-10 places that need
changing so that manually changing them is not a major issue.

I've been considering using hidden text at the spots in the text that
might need changing or using bookmarks. Are these workable ideas?
Which would be a better technique? Maybe there's another way entirely
separate that should be used.

I'd appreciate any suggestions that people with experience have on
this issue.

Thanks.

David
 

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