A
Alex St-Pierre
Hello!
I use automation to program a word report from excel vba. When I write the
following lines, I got the error msg Method _ParagraphFormat has failed. It
works 99% of the time. I don't know why it gives this error message sometimes.
Set oRange = docWord.Paragraphs(i).Range
oRange.ParagraphFormat.KeepWithNext = True 'error
oRange.ParagraphFormat.KeepTogether = True 'error too
Sometimes, only one or both gives error.. It often happens inside a table
when it takes 2 pages. I don't know what I can do in Excel to avoid that.
oRange.ParagraphFormat.KeepTogether = 99999999 or 0 before giving an error.
Thanks a lot!
Alex
I use automation to program a word report from excel vba. When I write the
following lines, I got the error msg Method _ParagraphFormat has failed. It
works 99% of the time. I don't know why it gives this error message sometimes.
Set oRange = docWord.Paragraphs(i).Range
oRange.ParagraphFormat.KeepWithNext = True 'error
oRange.ParagraphFormat.KeepTogether = True 'error too
Sometimes, only one or both gives error.. It often happens inside a table
when it takes 2 pages. I don't know what I can do in Excel to avoid that.
oRange.ParagraphFormat.KeepTogether = 99999999 or 0 before giving an error.
Thanks a lot!
Alex