View Single Post
 
Old 09-19-2015, 05:27 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Marrick13 View Post
the macro goes into an infinite loop if the last text in the document has the 'Heading 1' style
Easily fixed - simply insert:
If .End = ActiveDocument.Range.End Then Exit Sub
before:
.Collapse Direction:=wdCollapseEnd
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote