I've taken up again the second macro at #6 above, but I get problems.
I have a docx of 7 pages. I need to go to page 4 and then delete pages 4 to 7. The macro works all right on its own, but it deletes all the pages of the docx when inserted into a larger (very large) macro. Can someone fancy why? Thanks!
Code:
Sub DeleteFromPgToEnd()
Dim oRng As Range
Set oRng = ActiveDocument.Range
Set oRng = oRng.GoTo(What:=wdGoToPage, Name:=4)
Set oRng = oRng.GoTo(What:=wdGoToBookmark, Name:="\page")
oRng.End = ActiveDocument.Range.End
oRng.Delete 'doesn't delete the last empty page
oRng.Collapse wdCollapseEnd
oRng.Start = oRng.Start - 1
oRng.Delete 'deletes the last empty page
End Sub