Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 02-15-2019, 11:56 AM
AntiqueWhale AntiqueWhale is offline simpler way to delete a particular page in a Word document??? Windows 10 simpler way to delete a particular page in a Word document??? Office 2016
Novice
 
Join Date: Nov 2018
Posts: 11
AntiqueWhale is on a distinguished road
Smile

Quote:
Originally Posted by macropod View Post
That's about it, though you don't need to use Selection:
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
Still little confused

I think in your code, you set the rng start point using:
ActiveDocument.Goto(What:=wdGotopage, Name:iPage)
you set the rng endpoint using
rng.Goto(What:=wdGotoBookmark, Name:="\Page")
Could you elaborate on this?

And I write VBA code in Excel to manipulate Word behavior using late bind technology, I know I can not use any word object build in constant instead of using pure numerical value. Do you have any other caveat for me? Thanks!!!!!!
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
simpler way to delete a particular page in a Word document??? 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
simpler way to delete a particular page in a Word document??? 600 page document in word 2007 ggun123 Word 3 08-23-2011 06:54 AM
simpler way to delete a particular page in a Word document??? 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

Other Forums: Access Forums

All times are GMT -7. The time now is 12:58 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft