Reply
 
Thread Tools Display Modes
  #1   Report Post  
Dan_unique
 
Posts: n/a
Default Convert multiple lines of text to a single cell in a table

I have "records" that contain varying number of lines of text in each
record. Each line has a carriage return at the end (^p). Each record is
separated by two carriage returns (or I could put in a delimeter such as the
pipe symbol on this line if it helps).

I want to put each "record" in its own cell when I convert text to table. If
I do the straightforward conversion, each line in each record is in its own
cell.
  #2   Report Post  
Suzanne S. Barnhill
 
Posts: n/a
Default

Replace ^p with ^l; then replace ^l^l with ^p. This will give you each
record in a separate paragraph. Convert Table to Text separating at
paragraphs and using the appropriate number of columns.

Better still substitute tabs for the line breaks, and separate at the tabs
to make a row for each record. This will create a database that you can use
as a mail merge data source for not only the current label layout but any
other that may be needed (or envelopes or letters or anything else).

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Dan_unique" wrote in message
...
I have "records" that contain varying number of lines of text in each
record. Each line has a carriage return at the end (^p). Each record is
separated by two carriage returns (or I could put in a delimeter such as

the
pipe symbol on this line if it helps).

I want to put each "record" in its own cell when I convert text to table.

If
I do the straightforward conversion, each line in each record is in its

own
cell.


  #3   Report Post  
Dan_unique
 
Posts: n/a
Default

Thanks Suzanne. I sort of stumbled over the same approach myself. I am still
playing with the Macro to make it one click of the button. :-)

As for the mail merge option: that will work if I put a "header row" as the
first record. If I run it just as is, mail merge will look for the name of
the person who was #1 in my database as the first field when I set the
mailmerge template up. :-). I will also have to assume that a record has a
maximum number of lines In theory, it's infinite. In practice it's probably
about a dozen.

I don't want to put in a header record as I would like to be able to print
the report "stand alone."

The reason I want to put the record in a single cell is I then: remove the
border, set the rows so they don't break across the page, add some top and
bottom buffers, and then apply three columns to the page. The result is a
directory-like listing of my records where nothing gets orphaned.

Although the mail merge option might not work for this specific application,
I like the technique it implies: the ability to convert rows down to columns
accross. I am sure that will come in handy somewhere.

"Suzanne S. Barnhill" wrote:

Replace ^p with ^l; then replace ^l^l with ^p. This will give you each
record in a separate paragraph. Convert Table to Text separating at
paragraphs and using the appropriate number of columns.

Better still substitute tabs for the line breaks, and separate at the tabs
to make a row for each record. This will create a database that you can use
as a mail merge data source for not only the current label layout but any
other that may be needed (or envelopes or letters or anything else).

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Dan_unique" wrote in message
...
I have "records" that contain varying number of lines of text in each
record. Each line has a carriage return at the end (^p). Each record is
separated by two carriage returns (or I could put in a delimeter such as

the
pipe symbol on this line if it helps).

I want to put each "record" in its own cell when I convert text to table.

If
I do the straightforward conversion, each line in each record is in its

own
cell.



  #4   Report Post  
Suzanne S. Barnhill
 
Posts: n/a
Default

You don't need a table for what you want to do, though. If you convert each
record to a single paragraph (as already outlined), format the paragraph as
"Keep lines together," add Space Before/After as needed, and then flow it
into three columns, you get the same effect.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Dan_unique" wrote in message
...
Thanks Suzanne. I sort of stumbled over the same approach myself. I am

still
playing with the Macro to make it one click of the button. :-)

As for the mail merge option: that will work if I put a "header row" as

the
first record. If I run it just as is, mail merge will look for the name of
the person who was #1 in my database as the first field when I set the
mailmerge template up. :-). I will also have to assume that a record has a
maximum number of lines In theory, it's infinite. In practice it's

probably
about a dozen.

I don't want to put in a header record as I would like to be able to print
the report "stand alone."

The reason I want to put the record in a single cell is I then: remove the
border, set the rows so they don't break across the page, add some top and
bottom buffers, and then apply three columns to the page. The result is a
directory-like listing of my records where nothing gets orphaned.

Although the mail merge option might not work for this specific

application,
I like the technique it implies: the ability to convert rows down to

columns
accross. I am sure that will come in handy somewhere.

"Suzanne S. Barnhill" wrote:

Replace ^p with ^l; then replace ^l^l with ^p. This will give you each
record in a separate paragraph. Convert Table to Text separating at
paragraphs and using the appropriate number of columns.

Better still substitute tabs for the line breaks, and separate at the

tabs
to make a row for each record. This will create a database that you can

use
as a mail merge data source for not only the current label layout but

any
other that may be needed (or envelopes or letters or anything else).

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the

newsgroup so
all may benefit.

"Dan_unique" wrote in message
...
I have "records" that contain varying number of lines of text in each
record. Each line has a carriage return at the end (^p). Each record

is
separated by two carriage returns (or I could put in a delimeter such

as
the
pipe symbol on this line if it helps).

I want to put each "record" in its own cell when I convert text to

table.
If
I do the straightforward conversion, each line in each record is in

its
own
cell.




Reply
Thread Tools
Display Modes

Posting Rules

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
convert field codes to text in table of contents J.Enevoldsen Microsoft Word Help 2 April 15th 05 05:07 AM
Will auto text work on multiple enteries of a word in Word 2003 Buck Microsoft Word Help 2 March 24th 05 02:29 PM
Problem with text in table cell sunbeam Microsoft Word Help 1 February 16th 05 09:08 PM
Changing the format of text in a cell richardC Tables 3 January 7th 05 05:25 PM
Outline Renee Hendershott Page Layout 2 December 25th 04 02:49 PM


All times are GMT +1. The time now is 07:16 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"