Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / December 2003

Tip: Looking for answers? Try searching our database.

Logically deleted mergefield

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tony Bradford - 02 Dec 2003 14:15 GMT
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
visible in word via the find command, however if the "template" is opened up
in notepad the field name can be seen.

Excerpt from template

...mergefield O01_SUB_PMT_DTE1 \@"MMMM> yyyy"January" " mergefield
MRTG_PMT_DUE_DY \* Ordinal31st > mergefield O01_SUB_PMT_DTE1 \@"MMMM
yyyy"January" mergefield> MRTG_PMT_DUE_DY \* Ordinal31st  mergefield
EFF_DATE_4 \@"MMMM> yyyy"January 2004" mergefield MRTG_PMT_DUE_DY \*
Ordinal31st > mergefield EFF_DATE_4 \@"MMMM yyyy"January 2004"
mergefield> MRTG_PMT_DUE_DY \* Ordinal31st  mergefield EFF_DATE_4
\@"MMMM> yyyy"January 2004"30th  mergefield 01_SUB_PMT_DTE1 \@"MMMM>
yyyy"April 2003"30th 

The offending field in the above excerpt is EFF_DATE_4.

What appears to have happened is that this field was once used and was
deleted, but it appears that the template has held on to the reference. What
I am looking for is someway of cleaning up the template without having to
revert to manual cut & paste techniques.

Thank you

Tony Bradford
Cindy M  -WordMVP- - 02 Dec 2003 17:31 GMT
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 :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.