Occurence of "<body>" in text datasource causes failure.

B

Bruno Walter

I've found that if one of the fields in the datasource
contains the text "<body>" it results in Word being unable
to open the datasource.

I am prompted with a "Header Record Delimiters" dialog.
The delimiters are correct, but the preview frame is
incorrect in that text "<body>" does not appear. Instead
there appears to be a paragraph marker in it's place.

If I use any other text (including other "tags" such as
<div> or <b>) the mail merge works as expected. It
appears that word is attempting to interpret the occurence
of "<body>" in some undesired manner. Is there some way I
can get around this, perhaps by escaping it in some way?
 
P

Peter Jamieson

I tried to replicate this, but need more info.:
a. which version of Word?
b. what is the file called (e.g. is it a .txt file, a .htm file or what?)
 
C

Cindy M -WordMVP-

Hi Bruno,

1. Version of Word?

2. Occurrence in the field data, or field name?

3. What's the data source? Excel file? Text file? Word table?
Access database? Other?

As a test, if you set up a data source in a Word table do you
see the same problem?
I've found that if one of the fields in the datasource
contains the text "<body>" it results in Word being unable
to open the datasource.

I am prompted with a "Header Record Delimiters" dialog.
The delimiters are correct, but the preview frame is
incorrect in that text "<body>" does not appear. Instead
there appears to be a paragraph marker in it's place.

If I use any other text (including other "tags" such as
<div> or <b>) the mail merge works as expected. It
appears that word is attempting to interpret the occurence
of "<body>" in some undesired manner. Is there some way I
can get around this, perhaps by escaping it in some way?

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 :)
 
B

Bruno Walter

Version of word is 2002.

As the subject says, datasource is a text file. I tried
an .mdb file and it seems to work fine but if I use Access
to export the same .mdb file to .txt in word merge format
it fails.
 
C

Cindy M -WordMVP-

Hi Bruno,
Version of word is 2002.
Right. By default, Word 2002 (and 2003) uses OLE DB to
connect to the data source. I tested in both versions, and
noticed that in Word 2002 the prompt displayed to select the
field delimiter. And this dialog box showed a preview of the
data, and in that, Word was definitely trying to interpret
the HTML tags (<b> showed in bold, for example).

Word 2003 seems to take a different route, at least I got a
different dialog box prompting for the field delimiters that
did NOT show a preview. And although I had to specify the
field delimiter twice, there were no complications,
otherwise.

If I used a different connection method, such as ODBC or
Word's internal text converter, there were no problems at
all, in either version.

The OLE DB connection also worked just fine in Word 2002 if I
used a TAB field delimiter (rather than a semicolon) and
enclosed all the text entries that could be a problem in
"quotes".

When I tried to use semicolons, Word 2002 refused to
recognize the delimiter, even though I was prompted for it.
But at least as soon as I started using "quotes" I was
getting the dialog box I'm seeing in Word 2003 that doesn't
try to render a preview.

So, the key is to either NOT use OLE DB as the connection
method, or be sure to surround these text areas with
"quotes".
As the subject says, datasource is a text file. I tried
an .mdb file and it seems to work fine but if I use Access
to export the same .mdb file to .txt in word merge format
it fails.

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 :)
 

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