Word document report

J

JoMcGuire

I've tried all the vb constants that I can find, and I am hoping
someone can help me. I'm populating a form field in a word document
with multiple lines of data. I've tried vbcrlf and all the variations
along with the chr(10)s and (13)s. They all get the job accomplished
EXCEPT.. in Word... "return" adds a blank line between while
"shift_return" moves your cursor directly under the previous text.
Does anyone know a VBA constant that will accomplish the latter. I
have very long report with several lists and its very untidy to have
all these lists essentially double spaced.

Thanks.
 
A

Allen Browne

Jo, there doesn't seem to be any logic for it, but Word uses Chr(11) as a
new-line character.
 
T

Tim Ferguson

Jo, there doesn't seem to be any logic for it, but Word uses Chr(11)
as a new-line character.

It's a vertical tab character, so it kind of makes sense. It would be nice
if it were the same in powerpoint and excel etc too, though!

B wishes


Tim F
 
A

Allen Browne

It makes sense to use the page-feed character as a line-break?

Oh, my word! :)
 
J

JoMcGuire

Allen said:
Jo, there doesn't seem to be any logic for it, but Word uses Chr(11) as a
new-line character.

Thanks.. that did the trick. Now I just have to figure out why it's
shooting the last word of the string out to the far right.. hehe.. it's
always somethin'

Jo
 
J

JoMcGuire

Allen said:
Jo, there doesn't seem to be any logic for it, but Word uses Chr(11) as a
new-line character.

Thanks.. that did the trick. Now I just have to figure out why it's
shooting the last word of the string out to the far right.. hehe.. it's
always somethin'

Jo
 
T

Tim Ferguson

It makes sense to use the page-feed character as a line-break?

Oh, my word! :)

No, a page feed is a ctrl-L (Chr$(12) or FF); see
http://www.asciitable.com/

Advanced teletype control is (just) before my time but I imagine that a
ctrl-K is (was) sent to move the print head down to the next print
position on the same page, similar to a horizontal table.

A ctrl-J (LF) would be a more logical choice but would be confusing as
it's already part of the CR-LF end of line sequence. This is, however,
what Excel uses for a line feed in the middle of a cell. Powerpoint uses
ctrl-K for a new line, and (ctrl-M, ctrl-J) for a new paragraph, same as
Winword. From memory, I don't think an Access text box even recognises
the difference between a new paragraph and a new line.

Ah well...


Tim F
 

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