Different name in mergefield

294 Views Asked by At

I have a Word document with one mergeField who has name "NBJ"
MergeField

I open document.xml and I found

<w:instrText xml:space="preserve"> MERGEFIELD NB</w:instrText>

The document works fine, but I don't understand why I haven't the same merge field name ?

1

There are 1 best solutions below

4
On

Field coding can be split into more than one element, so if you have another look at your document's XML my guess is that you will find another such element whose text content starts with "J".

In general, when you are dealing with XML encoding in Word, you need to be aware that Word frequently splits texts into several pieces. It certainly isn't always obvious why, but two common reasons are:

  • There is different formatting for different parts of the text. You wouldn't normally need that or get that in the name of a merge field, but for example, the first "run" of a field code may be formatted because someone needs to use the *Charformat field switch to apply that format to the entire field result
  • Change tracking has recorded that you have changed/added/deleted one part of the text.