Fuzzhead was telling us:
Fuzzhead nous racontait que :
This works good until I get to the last page. When I run it on the
last page it does not delete it. It only deletes the text in the page.
This happens when it happens that the last ¶ of the document (which the code
does not delete) does not fit at the end of the page before lat (which
should be the last page when the code executes).
You will have to add code to detect if you are on the last page, if so,
handle that one separately. For example:
'_______________________________________
If Selection.Information(wdActiveEndAdjustedPageNumber) = _
ActiveDocument.ComputeStatistics(wdStatisticPages) Then
Selection.Bookmarks("\Page").Range.Delete
Selection.TypeBackspace
Else
Selection.Bookmarks("\Page").Range.Delete
End If
'_______________________________________
It will probably need modification according to the type of document you are
handling and the type of content.
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:
http://www.word.mvps.org