J
Jay
Hi,
In Word 97, I have a table cell with (for example) 6 paragraphs in it.
When I do a count of the number of paragraphs using
Selection.Paragraphs.Count, it returns 6. When I try to access each
paragraph (see below) everything works fine except for the final
paragraph (number 6 in this case), where the VBA copies and pastes the
entire contents of the cell rather than the final paragraph. Perhaps
this is because Word doesn't consider the last paragraph to be a real
paragraph, since it ends with an end-of-cell marker rather than a
paragraph marker? How can I get around this problem? Perhaps I should
be using a more direct method of moving things around than using copy
and paste? Feel free to change my code!
NumPara = Selection.Paragraphs.Count
For Para = 1 To NumPara
Selection.Tables(1).Cell(1, 1).Select
Selection.Paragraphs(Para).Range.Select
Selection.Copy
...
'code to paste the paragraph somewhere else
Next
Thanks,
Jay
In Word 97, I have a table cell with (for example) 6 paragraphs in it.
When I do a count of the number of paragraphs using
Selection.Paragraphs.Count, it returns 6. When I try to access each
paragraph (see below) everything works fine except for the final
paragraph (number 6 in this case), where the VBA copies and pastes the
entire contents of the cell rather than the final paragraph. Perhaps
this is because Word doesn't consider the last paragraph to be a real
paragraph, since it ends with an end-of-cell marker rather than a
paragraph marker? How can I get around this problem? Perhaps I should
be using a more direct method of moving things around than using copy
and paste? Feel free to change my code!
NumPara = Selection.Paragraphs.Count
For Para = 1 To NumPara
Selection.Tables(1).Cell(1, 1).Select
Selection.Paragraphs(Para).Range.Select
Selection.Copy
...
'code to paste the paragraph somewhere else
Next
Thanks,
Jay