> Avoid using the Selection.
Hi Alex,
Well, FWIW I'm able to duplicate the problem you describe. From what I can see in the VBA-Editor, it's not so much that Word crashes, but that the macro goes
into an unending loop. I'm guessing it gets into a comment range and can't get out... So your solution, as ugly as it seems, is probably as good as anything
else.
> I am trying to strip empty paragraphs from the beginning and end of a range (using MoveEndWhile and MoveStartWhile).
>
[quoted text clipped - 14 lines]
>
> but it looks ugly.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
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 :-)
Tony Jollans - 05 May 2006 20:21 GMT
When I first saw this, I tried it quickly and where there should have been a
chr(5) for the comment, I found a zero length character (range); I vowed to
come back and look later. Then sometime while I was out, my computer crashed
(USB problem unrelated to Word). Since restarting and restarting Word I am
completely unable to reproduce it. In normal circumstances I would put it
down to some sort of corruption but if you get it repeatedly there must be
circumstances which cause it - at the moment I don't know what they may be.
--
Enjoy,
Tony
> Hi Alex,
>
> Well, FWIW I'm able to duplicate the problem you describe. From what I can see in the VBA-Editor, it's not so much that Word crashes, but that the
macro goes
> into an unending loop. I'm guessing it gets into a comment range and can't get out... So your solution, as ugly as it seems, is probably as good as
anything
> else.
>
> > I am trying to strip empty paragraphs from the beginning and end of a range (using MoveEndWhile and MoveStartWhile).
> >
> > This is a part of a Word add-in that processes and transforms marked parts of a user-created document into a format that one of our applications
can digest.
> > My current "solution" is something like (translated to VBA):
> >
[quoted text clipped - 17 lines]
>
> This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-)