![]() |
|
#1
|
||||
|
||||
![]() 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
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]() Quote:
Yes, I didn't wanna use Selection all the time and that was why I was asking. I've thought of using Range.GoTo, but just didn't know to use wdGoToBookmark. Thanks for your example, always. |
#3
|
|||
|
|||
![]()
Then, how to delete several not continue page in word using Excel VBA. For example: I want to delete page 2,3, 7,9, 13 all at once.
|
#4
|
|||
|
|||
![]() Quote:
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!!!!!! |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Aston | Word | 9 | 04-27-2022 07:38 AM |
Can't delete word document | Sparky | Word | 1 | 04-18-2012 12:20 AM |
![]() |
ggun123 | Word | 3 | 08-23-2011 06:54 AM |
![]() |
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 |