Word 2000, 2003, XP Question

G

Guest

Hi,
We have an application that uses Word 97. This app takes data from an SQL
2000 databse and inserts it into Word tables using SQL views. This works fine
using Word 97. When we attempt to use Word 2000, 2003 or XP the insertion
works but if the text is multi-lined and contains CR- LF charcters, they
appear as square hollow boxes and the text all appears on one line. We would
really like to move up to later versions of Word but this problem prevents
this. Anyone have any ideas how we can resolve this issue? Thanks in advance.

Steve
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?U3RldmVuQg==?=,
We have an application that uses Word 97. This app takes data from an SQL
2000 databse and inserts it into Word tables using SQL views. This works fine
using Word 97. When we attempt to use Word 2000, 2003 or XP the insertion
works but if the text is multi-lined and contains CR- LF charcters, they
appear as square hollow boxes and the text all appears on one line. We would
really like to move up to later versions of Word but this problem prevents
this. Anyone have any ideas how we can resolve this issue?
Difficult to give you an answer, since you don't detail how the data is put into
Word. Generally, though, word doesn't like CR-LF. If this is programming code,
try using vbCR (Chr$(13)) for new paragraphs. The same should work for Word 97,
so that you can continue to use the same code for all Word versions.

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

Guest

Cindy,

Thank you very much for responding. The data is retrieved from an SQL view
and is placed in the template by vb code. The CR-LF already exist in the SQL
fields. Word 97 seems to interpret the CR-LF correctly and formats
accordingly. Unfortunately Word 2000 and subsequent versions do not. I hope
this answered your question and you can then give me some advice.

Steven
 
G

Guest

I have exactly the same problem in Word 2000 vs Word 97.

I have a Macro that builds up a text string as follows:

Str$ = "Part 1" & Chr(13) & "Part 2 and 3"

The macro then tries to find a sting in the underlying document and replace
it with the text that has been built up, with the included formating (ie a
carrige return and line feed between Part 1 and the rest.

In Word 2000,if the test is found in a normal paragraph then the formatting
is fine. If the text is found within a table the the CHR(13) is presented as
a square box and the formattting is not valid.

What can I put in the string to ensure I get the required line break even if
the text to be replaced is in a table.
 
G

Guest

Steven

I have discovered that if you replace the CHR(13) with a ^l (that a lower
case letter L) then it should introduce a manual line break which formats
correctly in a table or outside the table. Would you be able to preprocess
the string returned from your database prior to putting it into your word
table?

Hope this helps

Paul
 
G

Graham Mayor

You could use Chr(11) - a line break within a paragraph, but you seem to
have discovered this for yourself elsewhere in the thread?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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