Hi Susan,
I tried to extract text by looping through the paragraphs, yes it works for
tables almost. However, paragraphs are marked with return carriage (to see
this return symbol, go Tools->Option->View->Formatting marks->Select "All"),
so if the text in table has no return symbol followed by, it can't be
extracted. That's my biggest concern.
Start with an empty "test" document. Press ENTER once (to create an empty
paragraph). Insert a simple table. Type some text in the empty paragraph and
in the first table cell.
Now get the text for
ActiveDocument.Paragraphs(1).Range.Text
and
ActiveDocument.Paragraphs(2).Range.Text
Compare them very carefully. You'll find that the first returns a Chr$(13)
(paragraph mark = /r = carriage return in C-languages) at the end. The second
will have two additional characters: Chr$(13) + Chr$(7). The first is the
paragraph mark you're concerned about. The end-of-cell marker in the table
contains a "hidden" paragraph mark. It also contains an "end-of-cell"
character (the Chr$(7)). Basically, this is a pointer for Word to the internal
"table" that contains the cell formatting information. In order to make the
two paragraphs "equal" you'll need to cut off this last character from the
last paragraph in the cell. If you check the string for the presence of
Chr$(7) and, if it's found, remove it, you should be fine
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail