\* mergefiormat switch in index entries

G

gergelyv

Hello,

I have a rather technical question for which I couldn't find a definite
answer after hours of research. What I did find is that I'm not the first one
with this problem. Look at the following index entry:

Help{XE "Help" \* MERGEFORMAT}

The question is, is this valid and supported at all? Can the \* MERGEFORMAT
switch appear in index entries? I don't know how it was created. (Probably
some add-on software did it, possibly something like Robohelp, not sure.) But
I suffer from problems with index entries like the one above: if I try to
translate them using CAT tools like MemoQ or Trados, they become corrupted:

Help{xe "Help MERGEFORMAT }

My theory is that the whole \* MERGEFORMAT switch is invalid/unsupported in
index entries in Word. Reading the help gives me an impression that it
doesn't make sense to include them in index entries. Can someone confirm?
Thank you.

Bests,
Gergely
 
C

Cindy M.

Hi Gergely,
I have a rather technical question for which I couldn't find a definite
answer after hours of research. What I did find is that I'm not the first one
with this problem. Look at the following index entry:

Help{XE "Help" \* MERGEFORMAT}

The question is, is this valid and supported at all? Can the \* MERGEFORMAT
switch appear in index entries? I don't know how it was created. (Probably
some add-on software did it, possibly something like Robohelp, not sure.) But
I suffer from problems with index entries like the one above: if I try to
translate them using CAT tools like MemoQ or Trados, they become corrupted:

Help{xe "Help MERGEFORMAT }

My theory is that the whole \* MERGEFORMAT switch is invalid/unsupported in
index entries in Word. Reading the help gives me an impression that it
doesn't make sense to include them in index entries. Can someone confirm?
Certainly, it doesn't make any sense. But techically Word does support it, and
probably puts it into the field code when indexing is done using Word's
standard tools. Unfortunately, you don't mention which version of Word is
involved. I also have no idea how these tools you're using actually work behind
the scenes (what they do to make Word change the field code).

However, it shouldn't be a big deal to make a macro that will delete this from
the fields. Something like this, perhaps:

Sub RemoveMergeFormatFromXEFields()
Dim doc As Word.Document
Dim rngSearch As Word.Range
Dim sSearchTerm As String, sSearchField As String
Dim bFound As Boolean

bFound = True
sSearchTerm = " \* MergeFormat"
sSearchField = "^d XE"
Set doc = ActiveDocument
Set rngSearch = doc.Content
rngSearch.TextRetrievalMode.IncludeFieldCodes = True
rngSearch.TextRetrievalMode.IncludeHiddenText = True
rngSearch.Find.ClearFormatting
Do
With rngSearch.Find
.Text = sSearchField
.MatchCase = True
.Wrap = wdFindStop
bFound = .Execute
If bFound Then
With rngSearch.Find
.Text = sSearchTerm
.MatchCase = False
.Replacement.Text = ""
.Execute Replace:=wdReplaceOne

End With
rngSearch.Collapse wdCollapseEnd
End If
End With
Loop Until Not bFound
End Sub


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
G

gergelyv

Hi Cindy,

Thanks for your help!

Cindy M. said:
Certainly, it doesn't make any sense. But techically Word does support it, and
probably puts it into the field code when indexing is done using Word's

Well, I've tried very hard, and I beleive it's impossible to create an index
entry containing a \* MERGEFORMAT switch from the Word UI using the standard
tools. You can only create it by typing it in. The Preserve formatting
checkbox does not appear when creating an index entry.
(http://office.microsoft.com/en-us/word/HP051862221033.aspx)
standard tools. Unfortunately, you don't mention which version of Word is

It's Word 2003 in my case, but from the input of other users, I beleive it's
version independent.
involved. I also have no idea how these tools you're using actually work behind
the scenes (what they do to make Word change the field code).

Well, that's a dark area, since we are talking about closed source software.
All I know is that Trados uses a Word template to manipulate the document
directly in Word, while MemoQ and Deja Vu X (another similar tool which shows
the exact same behaviour) run Word in the background to extract translatable
text segments from documents and write the target language segments back into
them after translation.
However, it shouldn't be a big deal to make a macro that will delete this from
the fields. Something like this, perhaps:

Thanks, this might be very useful. But I'd still like to know if the index
entry in the original document was correct or not.

I've done a bit of further testing, and found that if instead of \*
MERGEFORMAT, I include \* TOTALLYINVALIDSWITCH, the exact same thing happens,
which supports my theory that \* MERGEFORMAT is indeed invalid in index
entries. (The index entry works before translation, that is you can create a
valid index from it, but the \* part disappers after translation with these
tools, and the text of the switch becomes part of the index entry.) I just
find it a bit frustrating that I can't find any documentation on what is
supported in index entries exactly. The help lists some switches for every
field type, but doesn't talk about where format switches like this can be
used.

Bests,
Gergely
 
C

Cindy M.

Hi Gergely,
But I'd still like to know if the index
entry in the original document was correct or not.
Some switches are simply "generally supported" - there's no information about
when a certain switch should not be used.

It's possible that the document where you see this problem was created in an
older version of Word, where the switch is inserted. And that due to problems
(what you're seeing) the way the Word UI works was changed. That would explain
why we (2003 and 2007) are not seeing it when we insert XE fields.

Since you say the people working with this are "version independent" I think you
need to incorporate a macro of some kind (perhaps talk to the companies
providing the software) in the document processing, at some point.
I've done a bit of further testing, and found that if instead of \*
MERGEFORMAT, I include \* TOTALLYINVALIDSWITCH, the exact same thing happens,
which supports my theory that \* MERGEFORMAT is indeed invalid in index
entries. (The index entry works before translation, that is you can create a
valid index from it, but the \* part disappers after translation with these
tools, and the text of the switch becomes part of the index entry.) I just
find it a bit frustrating that I can't find any documentation on what is
supported in index entries exactly. The help lists some switches for every
field type, but doesn't talk about where format switches like this can be
used.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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