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 / June 2004

Tip: Looking for answers? Try searching our database.

Word 97 and Word 2002  carriage return differences.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chad - 16 Jun 2004 17:29 GMT
Hello,

I am a developer, and my application writes a file
intended for mail merge use.  The field delimiter is a tab
and the record delimiter is a carriage return.  The first
record is a header to define the fields.

This mail merge file works as a datasource in Word 95,
Word 97 and Word 2000.  It does not work in Word 2002.

When I open the mail merge file for review in Word 2002
there is carriage return added to the last line in the
file.  This carriage return does not appear when I open
the same file in Word 95, Word 97 or Word 2000.

It is this carriage return that Word 2002 adds that causes
the mail merge to fail when this file is used as a
datasource.  If I manually remove the carriage return in
Word 2002 the mail merge is successful.

Any ideas on how I can solve this problem??

Thank you.

Chad
Cindy M  -WordMVP- - 17 Jun 2004 15:39 GMT
Hi Chad,

> I am a developer, and my application writes a file
> intended for mail merge use.  The field delimiter is a tab
> and the record delimiter is a carriage return.  The first
> record is a header to define the fields.
>  
What ANSI character(s) are you using to create the carriage
return?

In what way is the merge failing (error)? What file extension
are you using for the data file name? And is your code
linking in the data source, or just opening a document
already linked to the data source? If the first, please show
us the OpenDataSource method you're using.

> This mail merge file works as a datasource in Word 95,
> Word 97 and Word 2000.  It does not work in Word 2002.
[quoted text clipped - 8 lines]
> datasource.  If I manually remove the carriage return in
> Word 2002 the mail merge is successful.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun
8 2004)
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 :-)
Chad - 17 Jun 2004 16:02 GMT
Hello Cindy,

Thank you for taking the time to look at my posting.

I use a fwrite statement in my C++ code, that contains
a "/15".

The error I get is "Word could not merge the main document
with the data source because the data records were empty
or no data records matched your query options."

My application creates a "lease.doc" file.  I have tried
a .prn and .txt extension.

My application creates a file, there is no linking done to
word.  The user then opens word and uses the file as the
datasource when doing a mail merge.

Chad
 

>-----Original Message-----
>Hi Chad,
[quoted text clipped - 36 lines]
>
>.
Cindy M  -WordMVP- - 18 Jun 2004 17:47 GMT
Hi Chad,

thanks for the additional information.

> I use a fwrite statement in my C++ code, that contains
> a "/15".
>  
I'm not familiar with C++, so I don't know what ANSI
character code /15 corresponds to? But Word wants/expects
Chr$(13), and will sometimes balk if it gets a "standard"
Chr$(10)Chr$(13) (newline, carriage return). Does that
translate to anything meaningful for you?

> The error I get is "Word could not merge the main document
> with the data source because the data records were empty
[quoted text clipped - 6 lines]
> word.  The user then opens word and uses the file as the
> datasource when doing a mail merge.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun
8 2004)
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 :-)
Chad - 18 Jun 2004 22:02 GMT
Cindy,

Thank you.  I will explore this idea.  

Something changed in word 2002, the "\15" works in all
previous versions of word.

Chad

>-----Original Message-----
>Hi Chad,
[quoted text clipped - 31 lines]
>
>.
Cindy M  -WordMVP- - 20 Jun 2004 09:53 GMT
Hi Chad,

> Something changed in word 2002, the "\15" works in all
> previous versions of word.

Yes, it did. Unfortunately, I'm not exactly sure what
changed, as it would relate to what you're doing.

Word's default connection method is now OLE DB. And as best
I've been able to determine, it's more "forgiving" about
Chr$(13) vs. Chr$(10)Chr$(13) than earlier versions were...

And this is why I asked you to try with different
extentions on the file name. If OLE DB provider doesn't
recognize something as a text file, Word's internal text
converter should kick in, and that should behave as earlier
versions.

The only other possibility would be that you were using an
ODBC connection up until now, and the ODBC driver just
happened to be the only one recognizing this character. One
other thing you could try would be to activate "Confirm
conversions on open" in Tools/Options/General. Then you'll
be able to specify the connection method after choosing the
file. At this point, ODBC probably won't be listed, so
activate "Show all". you should then be able to choose the
Text ODBC driver and test whether that does give you the
result you remember.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 8 2004)
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
:-)
 
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.