Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
Nick Marinelli
 
Posts: n/a
Default Tables, Cells, Line Breaks and VBA

I have been searching for days with no reults, so any help is appreciated.

I am importing a pipe (|) delimited file into a Word document, and then
converting that text into a table, which is then appened to a table in a
template. The table in the template forces the correct column widths.

Now, in some of the cells there is text which contains a list of names.
Each name is supposed to appear on it's own line within the cell. If
I were typing this manually, I'd use SHIFT+ENTER to go to the next line.
However, since this is all being done in VBA, that is not possible.

My question: How do I mimick the action of pressing SHIFT+ENTER in the
VBA Module so that the text will fill the cell correctly? I've tried
Chr(10), Chr(13), Chr(10)+Chr(13), vbLf, vbCr, vbCrLf, but all these do
is place the text into the first cell of a new row in the table.

I've heard something about using ^l (carrot, little"L"), but if I try to
put that in within quotes, it appears as text, and VBA won't allow it
without quotes.

Help!

Thanks again

Nick
  #2   Report Post  
Posted to microsoft.public.word.tables
Jay Freedman
 
Posts: n/a
Default Tables, Cells, Line Breaks and VBA

The constant you want is the misleadingly named vbVerticalTab, which is the
same as Chr(11).

The ^l abbreviation works only in Find/Replace operations, not in string
constructions.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Nick Marinelli wrote:
I have been searching for days with no reults, so any help is
appreciated.

I am importing a pipe (|) delimited file into a Word document, and
then converting that text into a table, which is then appened to a
table in a template. The table in the template forces the correct
column widths.

Now, in some of the cells there is text which contains a list of
names. Each name is supposed to appear on it's own line within the
cell. If I were typing this manually, I'd use SHIFT+ENTER to go to
the next line. However, since this is all being done in VBA, that
is not possible.

My question: How do I mimick the action of pressing SHIFT+ENTER in the
VBA Module so that the text will fill the cell correctly? I've tried
Chr(10), Chr(13), Chr(10)+Chr(13), vbLf, vbCr, vbCrLf, but all these
do is place the text into the first cell of a new row in the table.

I've heard something about using ^l (carrot, little"L"), but if I try
to put that in within quotes, it appears as text, and VBA won't allow
it without quotes.

Help!

Thanks again

Nick



  #3   Report Post  
Posted to microsoft.public.word.tables
Nick Marinelli
 
Posts: n/a
Default Tables, Cells, Line Breaks and VBA

This isn't working. The text does not move down to the next line.

Any other ideas? Does the vbVerticalTab need to be put into the table
after it has been converted to Word?

Jay Freedman wrote:
The constant you want is the misleadingly named vbVerticalTab, which is the
same as Chr(11).

The ^l abbreviation works only in Find/Replace operations, not in string
constructions.

  #4   Report Post  
Posted to microsoft.public.word.tables
Nick Marinelli
 
Posts: n/a
Default Tables, Cells, Line Breaks and VBA

Okay, I got it. I had to put some text into the imported data where I
wanted the vbVerticalTabs to go, and then after the text was converted
to a table I did a Search and Replace to insert the vbVerticalTabs where
I wanted them. Now all is well.

Thanks for your help.

Nick

Nick Marinelli wrote:
This isn't working. The text does not move down to the next line.

Any other ideas? Does the vbVerticalTab need to be put into the table
after it has been converted to Word?

Jay Freedman wrote:

The constant you want is the misleadingly named vbVerticalTab, which
is the
same as Chr(11).

The ^l abbreviation works only in Find/Replace operations, not in string
constructions.

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:30 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"