R
Raphael Goubet
Hi,
In a macro I'm writing, I have a loop on each run of which I add some
paragraphs (one or more), contained in a string variable. Now, I'd
like these paragraphs to get a LeftIndent formatting. The trouble is,
I don't know how many paragraphs I'm inserting on each run of the
loop. So, if I write:
ActiveDocument.Paragraphs.Add.Range = MyText & vbCrLf
ActiveDocument.Paragraphs(ActiveDocument.Paragraphs.Count - 1).Format
= CommentPara
were CommentPara is a ParagraphFormat object whose LeftIndent property
is set as needed, only the last paragraph of the MyText Range is
formatted.
So, my question is: who can I apply CommentPara to all the paragraphs
inserted and contained in MyText? I tried to define MyText as a Range
object, format it and then insert it with the method Add, but it
didn't work.
Thanks in advance for your help.
Raphael
In a macro I'm writing, I have a loop on each run of which I add some
paragraphs (one or more), contained in a string variable. Now, I'd
like these paragraphs to get a LeftIndent formatting. The trouble is,
I don't know how many paragraphs I'm inserting on each run of the
loop. So, if I write:
ActiveDocument.Paragraphs.Add.Range = MyText & vbCrLf
ActiveDocument.Paragraphs(ActiveDocument.Paragraphs.Count - 1).Format
= CommentPara
were CommentPara is a ParagraphFormat object whose LeftIndent property
is set as needed, only the last paragraph of the MyText Range is
formatted.
So, my question is: who can I apply CommentPara to all the paragraphs
inserted and contained in MyText? I tried to define MyText as a Range
object, format it and then insert it with the method Add, but it
didn't work.
Thanks in advance for your help.
Raphael