chr(13) vbCrLF issue when passing to word

A

Alan

I am sure I have had this working before however now struggling ...
I am looking to export a table into MS Word fields however although the data
passes the Chr(13) and/or vbCrLf, this appears in the Word field as a square
rather than taking a new line.

I have the Word Object Library referenced and cant seem to find a reason why
this is not allowing me to take a new line for each entry.

Any help would be gratefully appreciated
 
A

Allen Browne

The carriage return + line feed (char 13 + 10) should work.

From memory, you have to send a Chr(11) to Word to get a line feed within a
paragraph. (I've no idea why Word uses this non-standard char.)
 
A

Alan

Allen

2 Dyas scratching my head and other parts of my anatomy and now solved.
I would never have though of Chr(11)

--
Many Thanks

(a less frustrated) Alan


Allen Browne said:
The carriage return + line feed (char 13 + 10) should work.

From memory, you have to send a Chr(11) to Word to get a line feed within a
paragraph. (I've no idea why Word uses this non-standard char.)
 
D

David W. Fenton

From memory, you have to send a Chr(11) to Word to get a line feed
within a paragraph. (I've no idea why Word uses this non-standard
char.)

Is that the one that you enter from the keyboard with SHIFT-ENTER?
 
A

Allen Browne

David W. Fenton said:
Is that the one that you enter from the keyboard with SHIFT-ENTER?

Yes: Shift+Enter in Word seems to be stored as a Chr(11) in the DOC.
 

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