View Single Post
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
n.almeida
 
Posts: n/a
Default The use of fields for the correct use "a" or "an"

Thanks Graham,
I had got that far (in a different way but I have not the code with me right
now) but my question was concentrating on not repeating the EducDiploma1 that
many times to be able to use it with different Bookmarks.
In the meantime I found out that toggling field codes, selecting the field
codes and using "find and replace" to replace the bookmark name works quite
well, and I would say fast enough.
But thanks, again.

"Graham Mayor" wrote:

This is a bit complicated but can be achieved -

{ IF{ =({ IF{ Mergefield EducDiploma1 \*Upper } = "A*" 1 0 } + { IF{
Mergefield EducDiploma1 \*Upper } = "E*" 1 0 } + { IF{ Mergefield
EducDiploma1 \*Upper } = "I*" 1 0 } + { IF{ Mergefield EducDiploma1
\*Upper } = "O*" 1 0 } + { IF{ Mergefield EducDiploma1 \*Upper } = "U*" 1
0 } + { IF{ Mergefield EducDiploma1 \*Upper } = "H*" 1 0 })} = 1 "an"
"a" } { MERGEFIELD EducDiploma1 }

You can check the first letter of the field by using a wildcard (eg) = H*
having added an upper case switch to the field you are checking (in case the
fields are not all upper case).


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



n.almeida wrote:
I have this Bookmark and its result some time is "Language Diploma"
some time is "Art History Degree".
I would like to insert this field { REF EducDiploma1 } in a text but a
grammar problem arises "a Language Diploma" or "an Art History
Degree".
How can I insert another field that recognises the first letter of
the next field.
OR
How can I insert the condition in the field itself but without
repating the { REF EducDiploma1 } many times (because it happens
often in the text with other bookmarks)
I hope it is clear
Thanks