Dave was telling us:
Dave nous racontait que :
> Hello All,
> I have a bookmark at the end of template called End. I'd like to be
> able to programatically get rid of any extra whitespace or unessary
> pages after this bookmark using a macro.
>
> Any suggestions? Any help would be greatly appreciated.
And if there is text after this bookmark?
If the text must go as well, then try this:
Dim cutRge As Range
Dim endPos As Long
With ActiveDocument
endPos = .Bookmarks("End").Range.End + 1
If endPos < .Range.End Then
'the -1 is to exclude the last ¶ in the document from the range to
delete
Set cutRge = .Range(endPos - 1, .Range.End - 1)
cutRge.Delete
End If
End With

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Dave - 28 Apr 2005 23:52 GMT
Thank you, I will give this a shot.
There should not be any text after the end bookmark since all text is
entered via userforms and preceeding bookmarks.
Thanks again!
> Dave was telling us:
> Dave nous racontait que :
[quoted text clipped - 22 lines]
> End If
> End With