Hi Tony,
You did look at the template with Alt+F9 to see the actual field codes (not
just the result display or preview, but the real codes)?
What I have seen before is that a field code gets nested into a the bracket of
another field code. You can't see that, but Word (and often VBA) does. One
thing you could try would be to delete the two merge fields either side of it.
If this is what happened, this should clear it out of the document (you'd need
to recreate these two merge fields, of course).
> I have encountered a mail merge error, in which the error refers to a
> missing mergefield in the data stream. On examination this data field is not
[quoted text clipped - 18 lines]
> I am looking for is someway of cleaning up the template without having to
> revert to manual cut & paste techniques.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
Tony Bradford - 04 Dec 2003 08:22 GMT
Hi Cindy,
I have viewed the template in both modes (ie toggled Alt-F9) and in both
case the offending merge field is not visible.
I am trying to aviod manually amending the template as we have over 200
templates to investigate, The software we are using is changing from using
word directly to using "Word libraries" (I assume it is calling the dll or
equivalent directly) which has caused this problem to occur.
I am interested in how VBA access these merge fields - have you any sample
code?
Many Thanks
Tony Bradford
> Hi Tony,
>
[quoted text clipped - 37 lines]
> This reply is posted in the Newsgroup; please post any follow question or
> reply in the newsgroup and not by e-mail :-)
Cindy M -WordMVP- - 06 Dec 2003 11:47 GMT
Hi Tony,
> I have viewed the template in both modes (ie toggled Alt-F9) and in both
> case the offending merge field is not visible.
If it's field corruption, as I'm beginning to suspect, then you will NEVER
be able to see these. Nor will you be able to "extract" them. Your only
choice will be to completely replace the "broken" field.
When I said VBA can "see" them, I meant if you do a For Each field in
doc.Fields VBA will pick them up. But it can't manipulate (delete) them. At
least, not that I've ever found. The structure isn't what it's supposed to
be, and the internal tables that manage these things are damaged.
But this is all speculation until you actually try what I advised in my last
message to see if that is really what's going on.
> I am trying to aviod manually amending the template as we have over 200
> templates to investigate, The software we are using is changing from using
[quoted text clipped - 3 lines]
> I am interested in how VBA access these merge fields - have you any sample
> code?
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)