I have a list of pages that I want to delete in MS Word such as Page number : 5 to 10 , 12-16 etc. through Microsoft Excel VBA.
I found a code to delete specific pages through MS Word VBA. How can it be achieved through MS Excel VBA.
I found a code to delete specific pages through MS Word VBA. How can it be achieved through MS Excel VBA.
VBA Code:
Dim Rng As Range, iPage As Long
iPage = 2
With ActiveDocument
Set Rng = .GoTo(What:=wdGoToPage, Name:=iPage)
Set Rng = Rng.GoTo(What:=wdGoToBookmark, Name:="\page")
Rng.Delete
End With