Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-26-2014, 01:02 PM
mbesspiata mbesspiata is offline Remove Page Break in VBA Windows 7 64bit Remove Page Break in VBA Office 2010 64bit
Advanced Beginner
Remove Page Break in VBA
 
Join Date: Mar 2011
Location: Virginia
Posts: 57
mbesspiata is on a distinguished road
Default Remove Page Break in VBA

I have created a macro to resize and format a report from a text file. I have added a macro to add a page break prior to a certain word that appears at the top of each page in the text file. The problem is my report always give me a blank page to start the completed report. How can I remove that initial page break ONLY?



Mike
Reply With Quote
  #2  
Old 02-26-2014, 02:55 PM
macropod's Avatar
macropod macropod is offline Remove Page Break in VBA Windows 7 32bit Remove Page Break in VBA Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Depending on what's on the first page it might be nothing more complicated than:
ActiveDocument.Range.Characters.First.Delete
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 02-27-2014, 05:54 AM
mbesspiata mbesspiata is offline Remove Page Break in VBA Windows 7 64bit Remove Page Break in VBA Office 2010 64bit
Advanced Beginner
Remove Page Break in VBA
 
Join Date: Mar 2011
Location: Virginia
Posts: 57
mbesspiata is on a distinguished road
Default

That didn't work. The first page still shows up as blank. I can bring up the hidden characters and it looks like a bunch of small dots with Page Break in the middle.


Reply With Quote
  #4  
Old 02-27-2014, 02:11 PM
macropod's Avatar
macropod macropod is offline Remove Page Break in VBA Windows 7 32bit Remove Page Break in VBA Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

That suggests there's something other than just the page break on your first page - paragraph breaks and/or spaces perhaps? If there's just a single paragraph break (a symbol that looks like ¶) before the page break, simply execute the line of code I posted twice. If there's more than that, post back with the details.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 02-28-2014, 05:10 AM
mbesspiata mbesspiata is offline Remove Page Break in VBA Windows 7 64bit Remove Page Break in VBA Office 2010 64bit
Advanced Beginner
Remove Page Break in VBA
 
Join Date: Mar 2011
Location: Virginia
Posts: 57
mbesspiata is on a distinguished road
Default

I got it figured out. You can't use the mouse to select items when using the record macro tool. So I just used the keyboard when recording to get the code for removing the page break and it worked. I just used shift/end to highlight and then delete. Thanks for your help.

Mike
Reply With Quote
  #6  
Old 02-28-2014, 02:26 PM
macropod's Avatar
macropod macropod is offline Remove Page Break in VBA Windows 7 32bit Remove Page Break in VBA Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

That's a less-than-ideal way of doing things in VBA but, if it works for you, I guess that's what matters.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove Page Break in VBA Delete a page after Section Break Next Page Aston Word 9 04-27-2022 07:38 AM
Remove Page Break in VBA First section will not 'insert' blank page even though sectn 2 is 'odd' page break Pat_Hodgson Word 6 12-01-2013 04:22 PM
Remove Page Break in VBA Section Break (Next Page) replaces Section Break (Continuous) when deleted Carlabasson Word 2 03-25-2013 10:13 PM
Remove Page Break in VBA Remove unwanted Page in a Section Break JacobReef Word 1 06-10-2012 07:04 AM
Remove Page Break in VBA How do I Remove Break? freschij Word 1 11-05-2010 08:40 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:31 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