Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-22-2013, 09:36 AM
seeker62 seeker62 is offline delete page break Windows 7 64bit delete page break Office 2010 64bit
Novice
delete page break
 
Join Date: Jul 2013
Posts: 9
seeker62 is on a distinguished road
Default delete page break

I want to delete page break using vba. This is what I am using:

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

When I step through the value passed to Rng is "..................

how can the above code be changed to accomplish my purpose? Also need to change footer after i delete page break.
Reply With Quote
  #2  
Old 07-22-2013, 11:21 AM
Charles Kenyon Charles Kenyon is offline delete page break Windows Vista delete page break Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,081
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

I do not see this code as deleting a page break. This deletes a page of text more or less.

What, exactly, are you trying to do? Keep in mind that to Word, the concept of "page" is ambiguous, defined in relationship to the current printer driver.

Why do you need to change your footer? What is in it that needs to be different?
Reply With Quote
  #3  
Old 07-22-2013, 11:36 AM
seeker62 seeker62 is offline delete page break Windows 7 64bit delete page break Office 2010 64bit
Novice
delete page break
 
Join Date: Jul 2013
Posts: 9
seeker62 is on a distinguished road
Default

when the table that holds locations is lengthened so a new row can be added the next section goes to a new page with added whitespace because the page break that is auto entered goes with the section. If I manually delete that page break then the footer changes from 1 of 2 to 2 of 2 thus requireing a correction to the footer to put it back to 1 of 2. I am trying to create a macro so that when the user opens it they can use a key combo to delete the page break and correct the footer before she begins making edits to the document.
Reply With Quote
  #4  
Old 07-22-2013, 06:49 PM
Charles Kenyon Charles Kenyon is offline delete page break Windows Vista delete page break Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,081
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

I thought I replied earlier but don't see it.

Tables and section breaks are very different from page breaks. Code does not address what you are trying to do.

You should not have to change the footer. Your page numbers should be set using Page fields, not typed directly into the footer.

Can you post a sample document (without proprietary info) that has the problem.

Sections / Headers and Footers in Microsoft Word 2007-2013
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
delete page break Delete a page after Section Break Next Page Aston Word 9 04-27-2022 07:38 AM
delete page break Section Break (Next Page) replaces Section Break (Continuous) when deleted Carlabasson Word 2 03-25-2013 10:13 PM
Page break? Jon Word 3 01-29-2013 09:08 AM
delete page break Delete Page Break using VBA wordpunk Word VBA 1 07-03-2012 03:05 PM
paragaph hard break, soft break and ...strange break czomberzdaniela Word 2 12-03-2010 06:58 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:03 AM.


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