Private
Sub
CommandButtonPD1_Click()
Dim
Auswahl
As
Variant
Dim
Seite
As
Range
Dim
Seitenende
As
Range
Dim
Seitenanzahl
As
Variant
Seitenanzahl = ActiveDocument.ComputeStatistics(wdStatisticPages)
Auswahl = InputBox(
"Which Page do you want to delete?"
& Chr(10) & Chr(10) &
"This Document consists of "
& Seitenanzahl &
" Pages."
& Chr(10) &
"Do not delete the last blank Page if you still want to copy the Page Model."
,
"Copy Page"
)
If
Auswahl =
""
Or
Not
IsNumeric(Auswahl)
Or
(IsNumeric(Auswahl)
And
Auswahl > Seitenanzahl
And
Auswahl < 1)
Then
Exit
Sub
Selection.
GoTo
what:=wdGoToPage, which:=wdGoToNext, Name:=Auswahl
Set
Seite = ActiveDocument.Bookmarks(
"\Page"
).Range
Seite.SetRange Seite.Start, Seite.
End
Seite.
Select
Selection.Cut
Seite.Delete
Seite.
Select
Selection.TypeBackspace
End
Sub