![]() |
|
#6
|
|||
|
|||
|
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
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Delete a page after Section Break Next Page
|
Aston | Word | 9 | 04-27-2022 07:38 AM |
| Can't delete word document | Sparky | Word | 1 | 04-18-2012 12:20 AM |
600 page document in word 2007
|
ggun123 | Word | 3 | 08-23-2011 06:54 AM |
How to delete one PAGE in word 2002?
|
Sleeper | Word | 2 | 06-28-2011 04:58 PM |
| delete subtitle on a word document damn thing will not go | waynegr | Word | 0 | 07-09-2006 06:15 AM |