View Single Post
 
Old 01-28-2012, 08:12 PM
Jennifer Murphy's Avatar
Jennifer Murphy Jennifer Murphy is offline Windows XP Office 2007
Competent Performer
 
Join Date: Aug 2011
Location: Silicon Valley
Posts: 234
Jennifer Murphy is on a distinguished road
Default

Paul,

Thanks for the suggestions.

The reason I selected the whole table was because I wanted the "Do not break" option to be applied to all rows. From your code, it appears that the

Code:
With Selection.Tables(1)
 
   ...
 
End With
acts as if the table were selected within that With block. Is that correct? This is indeed much better code.

The other change that I noticed is you changed my test from "<> True" to "= False". Is there a reason for that? I wrote it my way in case there is some other possibility besides True and False, such as Null or Empty. I have been burned before, especially with VBA, when the application (Word) returns odd results. I want to do something if it's true only.
Reply With Quote