This is the same thing with an Input box to get the page number.
I changed iPage to an Integer because I didn't understand the need for a long variable there.
There may be a type mismatch between the Input Box result and the variable but it seems to work.
Code:
Dim Rng As Range, iPage As Integer
On Error Resume Next
iPage = InputBox("Which page do you want to delete.", "Delete Page")
With ActiveDocument
Set Rng = .GoTo(What:=wdGoToPage, Name:=iPage)
Set Rng = Rng.GoTo(What:=wdGoToBookmark, Name:="\page")
Rng.Delete
End With
One other thought: While deleting a page this way will work, "page" is seldom a logical part of a Word document unless you are using manual page breaks. Inserting manual page breaks is generally not a good formatting practice.