editing index entries

A

alex_watson_uk

I use either Word 2001 or Word X. I get the same problem with both.

When marking things to appear in the index I have done a few 'Mark
All's which have created index entries (or should I say 'fields'?) that
now need editing. For example every time VP occurs in the main text of
the book it is now followed by { XE "VP" }. But in fact I want the
entry in the index to read Vidyapada (VP). In other words I need to
replace every instance of { XE "VP" } with { XE "Vidyapada (VP)" }. I
was hoping I could do this by using the search and replace function.
But searching for { XE "VP" } does not yield any results. These index
fields appear not to be there for the search function. An article on
mvps implies that they are findable if the font is set to hidden text.
This does not work unless I am doing something wrong. I bring up the
Find dialogue box, then Format -> Font. This brings up a 'Find Font'
box that underneath the Fonts section has a section called Effects, one
item under which is Hidden. I tick this. When I return to the window,
'Hidden' is written under the blank space where one types the term one
wants to search for. If I type in XE there, it finds nothing. If I
leave it blank it finds instances of hidden text, BUT it doesn't find
any index fields. These don't seem to be regarded as hidden texts.

How can I search for these index fields. Even if I just highlight and
copy an index entry such as { XE "VP"}, click in the search window and
press paste, nothing happens. It is not even possible to paste them
into a search window. Can anyone help?
 
D

Daiya Mitchell

There's a secret code to tell Word you are searching for a field, which is
either ^d or ^19. So ^19 XE searches for index fields. You don't need the
field braces, or I guess the ^19 replaces them. A typed { is not recognized
as a field brace anyhow.

Hit opt-F9 to make sure field codes are showing, and also set hidden text to
show, so that the index fields are visible in the doc. (I don't *think* you
need to tell Find to search for hidden text)

You can test this on a COPY of the doc, because I think it will fail:

Find box: ^19 XE "VP" should find all the VP fields
Replace box: ^19 XE "Vidyapada (VP)" might work

Except, I don't think it's as easy as that, because using ^19 XE in the
replace box will not create a field, and I'm not sure F&R is smart enough to
go, oh, I'm not really supposed to replace the whole thing.

It's possible, as long as all the field codes are showing, that finding "VP"
formatted as Hidden and replacing it with "Vidyapada (VP)" formatted as
Hidden will work--so that F&R will just search inside the fields instead of
finding the fields themselves. Maybe you should try that first. If it
doesn't work, try it without the Hidden formatting.

Can you point me toward the article you mention, on word.mvps.org? I'm
still learning this stuff.

DM
 
J

John McGhie [MVP - Word and Word Macintosh]

Hi Alex:

You need to search for the content String within the Index tag, not the
entire tag.

If you search for a "field", you will find the field, but not the content.
A field is a data structure: if you return the thing as a field, you have to
perform an extra step to extract the components before you can read the
text. You can do this in VBA or AppleScript, but the Find/Replace mechanism
can't.

So you would need to search for the "text content" of the field. Search for
'XE "VP"' and you will find it. Replace with 'XE "Vidyapada (VP)"' Switch
OFF Smart Quotes when you are doing this: field codes do not like smart
quotes internally.

And now you know why we recommend that you DON'T use "Mark All" or
concordance files :) The effort required to edit the index tags far
exceeds the effort involved in tagging them individually in the first place
:)

It's nice to have the Mark All and Concordance abilities in Word. I use
them a lot: mainly for processing text during website publishing. But I
never use them for Indexes :)

Hope this helps


I use either Word 2001 or Word X. I get the same problem with both.

When marking things to appear in the index I have done a few 'Mark
All's which have created index entries (or should I say 'fields'?) that
now need editing. For example every time VP occurs in the main text of
the book it is now followed by { XE "VP" }. But in fact I want the
entry in the index to read Vidyapada (VP). In other words I need to
replace every instance of { XE "VP" } with { XE "Vidyapada (VP)" }. I
was hoping I could do this by using the search and replace function.
But searching for { XE "VP" } does not yield any results. These index
fields appear not to be there for the search function. An article on
mvps implies that they are findable if the font is set to hidden text.
This does not work unless I am doing something wrong. I bring up the
Find dialogue box, then Format -> Font. This brings up a 'Find Font'
box that underneath the Fonts section has a section called Effects, one
item under which is Hidden. I tick this. When I return to the window,
'Hidden' is written under the blank space where one types the term one
wants to search for. If I type in XE there, it finds nothing. If I
leave it blank it finds instances of hidden text, BUT it doesn't find
any index fields. These don't seem to be regarded as hidden texts.

How can I search for these index fields. Even if I just highlight and
copy an index entry such as { XE "VP"}, click in the search window and
press paste, nothing happens. It is not even possible to paste them
into a search window. Can anyone help?

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 4 1209 1410
 
A

alex_watson_uk

Thanks very much to Daiya and John for your messages. Piecing together
things that both of you said, I have managed to find a solution for the
time being. Re. the suggestion:
Find box: ?^19 XE "VP" ?
Replace box: ? ^19 XE "Vidyapada (VP)"

as Daiya suspected, the find operation is successful: it finds all the
index fields which read { XE "VP" }, but the replace operation puts
into my document, ^19 XE "Vidyapada (VP)". There are obviously
problems with this: it doesn't include the curly braces; it is not
recognized as an index field by the 'insert index' command; and it is
not in hidden text so it prints as part of the text of my document.
So you would need to search for the "text content" of the field. ?Search for
'XE "VP"' ?and you will find it. ?Replace with 'XE "Vidyapada (VP)"'

That did not work actually. It doesn't find anything. But if I remove
the XE from both the search and replace windows, it works. There is
the potential problem that instances of VP that occur in my main text,
not in index fields, will be found. But this isn't much of an issue
actually, as there are very few cases where VP in my main text is
enclosed by double quotes: the inclusion of the double quotes in my
search window pretty much reduces the results found to index fields.

As to Daiya's suggestion:
It's possible, as long as all the field codes are showing, that finding "VP"
formatted as Hidden and replacing it with "Vidyapada (VP)" formatted as
Hidden will work--so that F&R will just search inside the fields instead of
finding the fields themselves. Maybe you should try that first.

How do I format it as hidden? I have tried the following.

I bring up the
Find dialogue box, then Format -> Font. This brings up a 'Find Font'
box that underneath the Fonts section has a section called Effects, one

item under which is Hidden. I tick this. When I return to the Find
window,
'Hidden' is written under the blank space where one types the term one
wants to search for. Is that how I 'format it as hidden'? If I type in
VP now in the search window, it finds nothing. If I
leave it blank it finds instances of hidden text, BUT it doesn't find
any index fields. These don't seem to be regarded as hidden texts.

Daiya said:
If it
doesn't work, try it without the Hidden formatting.

That seems to be the answer. Thank you very much.

The mvps article I referred to is at:
http://word.mvps.org/FAQs/Formatting/Createindex.htm
When advising how to find things (semi-colons in particular) in index
fields it says:
Reveal your hidden text (so you can see your XE tags)
then search for a semi-colon with the font format
hidden text.

But as explained above, this simply does not work for me, unless I'm
doing something wrong. If anyone can enlighten me about that it would
be great.

With *much* gratitude that people who owe me nothing spend time
answering my questions,

Alex
 
D

Daiya Mitchell

Thanks very much to Daiya and John for your messages. Piecing together
things that both of you said, I have managed to find a solution for the
time being.

Glad to hear it.
as Daiya suspected, the find operation is successful: it finds all the
index fields which read { XE "VP" }, but the replace operation puts
into my document, ^19 XE "Vidyapada (VP)".

Yeah, thought so, though my semi-test produced square boxes instead of ^19.
If you ever want to *delete* index fields, replacing with nothing works real
well. :)
How do I format it as hidden? I have tried the following.

That was correct, which is why I didn't bother to correct it, but ought to
have confirmed, sorry. So long as Hidden shows up under the appropriate box
in the dialog, it works.

I am not sure whether you used the Format | Font in the F&R dialog (must
expand the dialog by clicking the blue arrow to see it) or the regular one,
but your post taught me that either worked, which I didn't know.
The mvps article I referred to is at:
http://word.mvps.org/FAQs/Formatting/Createindex.htm
When advising how to find things (semi-colons in particular) in index
fields it says:


BUT it doesn't find
any index fields. These don't seem to be regarded as hidden texts.

Thanks for reporting this so thoroughly. Might be a glitch in the article,
might be a change in Word since it was written, conceivably could be a
Mac/win difference though I doubt it. Interestingly, I don't think
A) I've seen anyone else notice this
B) hidden text was mentioned the last time I saw an F&R for index fields
advise, other than showing it.

DM
 

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