Sub DeletePagesXtoY()
Dim startRange As Range
Dim endRange As Range
Dim iStart As Integer
Dim iEnd As Integer
iStart = 249
iEnd = 257
Set startRange = ActiveDocument.GoTo(What:=wdGoToPage, Which:=wdGoToAbsolute, Count:=iStart)
' Set the start of page 291
Set endRange = ActiveDocument.GoTo(What:=wdGoToPage, Which:=wdGoToAbsolute, Count:=iEnd)
' Select the range between page 230 and 290
startRange.SetRange Start:=startRange.Start, End:=endRange.Start
' Delete the selected range
startRange.Delete
End Sub
Tuesday, December 24, 2024
VBA Word - Delete pages of document between a range
The following VBA code deletes pages of Word document between a range.
Subscribe to:
Post Comments (Atom)
Hot Topics
-
In the previous post we have learnt about SSMS (SQL Server Management Studio) and how to connect with a SQL Server instance. In this post w...
-
By Ajeet Kumar RADAR CHART In radar chart, the categorical variable is displayed as spikes radiating from a central point. The values o...
-
In previous post , we learnt basic introduction to SQL Server . In this post we will learn about SSMS (SQL Server Management Studio) softwar...
No comments:
Post a Comment