![]() |
|
#1
|
|||
|
|||
![]()
Hello All,
This may be a very simple issue to all of you but I have been having hard time cracking this. I have a word template which is of 2 pages, it has just one page break, I have vba code in Excel, which opens this template, manipulates something and then saves the template with a different name. However, I have now realized that in some cases I need to delete that page break. What vba code should I include to make this happen. Any help would be greatly appreciated! |
#2
|
||||
|
||||
![]()
Try:
Code:
Sub Demo() Dim Rng As Range With ActiveDocument Set Rng = .GoTo(What:=wdGoToPage, Name:=1) Set Rng = Rng.GoTo(What:=wdGoToBookmark, Name:="\page") Rng.End = Rng.End - 2 Rng.Collapse wdCollapseEnd If Asc(Rng.Characters.Last) = 12 Then Rng.Delete End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Aston | Word | 9 | 04-27-2022 07:38 AM |
![]() |
Tom0822 | Excel | 1 | 03-19-2012 08:50 PM |
![]() |
don madsen | Word | 1 | 09-03-2011 07:46 AM |
paragaph hard break, soft break and ...strange break | czomberzdaniela | Word | 2 | 12-03-2010 06:58 PM |
Page Break | Manolo | Word | 0 | 04-29-2009 11:04 PM |