View Single Post
 
Old 11-18-2023, 03:50 AM
vivka vivka is offline Windows 7 64bit Office 2016
Expert
 
Join Date: Jul 2023
Posts: 293
vivka is on a distinguished road
Default

Hi, RobiNew! I've tested your code and it does delete the last page (if I understand correctly your objective). For me the following code also deletes the doc's last page:
Code:
Sub Delete_Last_Page()

Dim rng as range    
    Set rng = ActiveDocument.range.GoTo(wdGoToPage, wdGoToLast)
    rng.End = ActiveDocument.range.End
    rng.Delete
End sub
Reply With Quote