#1   Report Post  
Posted to microsoft.public.word.docmanagement
Dion Starfire Dion Starfire is offline
external usenet poster
 
Posts: 2
Default Convert tabs to spaces

Is there a way to convert a tab into however many spaces are needed to reach
the next tab stop?

I'm trying to convert an html table to a plain text file. Some of the cells
contain multiple lines. Currently, I copy into word, convert the table to
tab-delimited text, then save as plain text. However, this destroys the
column alignment, and messes up the multi-line 'cells'.

If there's not a built in function for this, how could I write a macro to do
this? (I'm at the 'dabbler' proficiency level, but am very good at using the
built-in help system).
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
JoAnn Paules JoAnn Paules is offline
external usenet poster
 
Posts: 4,241
Default Convert tabs to spaces

The number of spaces are going to vary depending on your font and font size.
Plain text tables *never* look as pretty as a table with formatting.

--

JoAnn Paules
MVP Microsoft [Publisher]

~~~~~
How to ask a question
http://support.microsoft.com/KB/555375


"Dion Starfire" wrote in message
...
Is there a way to convert a tab into however many spaces are needed to
reach
the next tab stop?

I'm trying to convert an html table to a plain text file. Some of the
cells
contain multiple lines. Currently, I copy into word, convert the table to
tab-delimited text, then save as plain text. However, this destroys the
column alignment, and messes up the multi-line 'cells'.

If there's not a built in function for this, how could I write a macro to
do
this? (I'm at the 'dabbler' proficiency level, but am very good at using
the
built-in help system).


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Convert tabs to spaces

What you are experiencing is inevitable and nothing to do with the plain
text nor the tabs. It concerns the fact that if you have multi-line cell
content, then that content will no longer be multi-line if you convert the
table to text (or save the document containing the table) as plain text. The
cell content opens out and displaces the remaining text, which would remain
tabbed. Frankly I don't see how a macro would be able to sort out such a
random mess.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Dion Starfire wrote:
Is there a way to convert a tab into however many spaces are needed
to reach the next tab stop?

I'm trying to convert an html table to a plain text file. Some of the
cells contain multiple lines. Currently, I copy into word, convert
the table to tab-delimited text, then save as plain text. However,
this destroys the column alignment, and messes up the multi-line
'cells'.

If there's not a built in function for this, how could I write a
macro to do this? (I'm at the 'dabbler' proficiency level, but am
very good at using the built-in help system).



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Dion Starfire Dion Starfire is offline
external usenet poster
 
Posts: 2
Default Convert tabs to spaces

I could almost do this with a simple find and replace, if I could figure out
how to replace the tab with the required number of spaces (varies from line
to line, depending on length of content before tab).

After converting the table to text, the line from the multi-line cells end
with a manual line break, while each (formerly) cell rowends with a paragraph
mark.

So:
replace [character followed by tab] with X spaces, where x equals the
difference between the location of the tab character and the next tab stop.

replace [line break followed by tab] with a number of spaces equal to the
location of the tab (expressed in character columns)



"Graham Mayor" wrote:

What you are experiencing is inevitable and nothing to do with the plain
text nor the tabs. It concerns the fact that if you have multi-line cell
content, then that content will no longer be multi-line if you convert the
table to text (or save the document containing the table) as plain text. The
cell content opens out and displaces the remaining text, which would remain
tabbed. Frankly I don't see how a macro would be able to sort out such a
random mess.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Dion Starfire wrote:
Is there a way to convert a tab into however many spaces are needed
to reach the next tab stop?

I'm trying to convert an html table to a plain text file. Some of the
cells contain multiple lines. Currently, I copy into word, convert
the table to tab-delimited text, then save as plain text. However,
this destroys the column alignment, and messes up the multi-line
'cells'.

If there's not a built in function for this, how could I write a
macro to do this? (I'm at the 'dabbler' proficiency level, but am
very good at using the built-in help system).




  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Convert tabs to spaces

Dion Starfire wrote:
I could almost do this with a simple find and replace, if I could
figure out how to replace the tab with the required number of spaces
(varies from line to line, depending on length of content before tab).


And that's exactly the problem for any solution!

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



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
Replace spaces with tabs Amandar097 Microsoft Word Help 3 August 7th 07 03:56 PM
How to measure (exactly) in centimeters tabs and spaces disciple Page Layout 1 June 27th 07 06:10 AM
How do I search and replace tabs with spaces? crazysher Microsoft Word Help 3 September 8th 06 03:43 AM
tabs and spaces Little_Jimmy Microsoft Word Help 4 January 27th 06 07:09 PM
seeing symbols for tabs and spaces Kevin Microsoft Word Help 1 December 28th 04 03:30 PM


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