Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word VBA

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 07-17-2013, 08:30 AM
dexter30 dexter30 is offline Windows Vista Office 2003
Novice
 
Join Date: Apr 2013
Posts: 20
dexter30 is on a distinguished road
Default Remove empty lines at the top of every page

Hi, I would like to perform the actions described below, in a Word document. Those two procedures must be performed for the same page, before moving on to the next page.

Example:

Go to page 1:

Remove all empty lines at the top of page 1

Search: ([!^13A-z]^13)(Nș)
Replace: \1^13\2


**



Go to page 2:

Remove all empty lines at the top of page 2

Search: ([!^13A-z]^13)(Nș)
Replace: \1^13\2


**

And so on to the last page.

Thank you.

Last edited by dexter30; 07-18-2013 at 07:49 AM.
Reply With Quote
  #2  
Old 08-01-2013, 08:21 AM
dexter30 dexter30 is offline Windows Vista Office 2003
Novice
 
Join Date: Apr 2013
Posts: 20
dexter30 is on a distinguished road
Default

Any ideas? Anyone?
Reply With Quote
  #3  
Old 08-05-2013, 08:37 PM
Charles Kenyon Charles Kenyon is offline Windows Vista Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 5,458
Charles Kenyon is a glorious beacon of lightCharles Kenyon is a glorious beacon of lightCharles Kenyon is a glorious beacon of lightCharles Kenyon is a glorious beacon of lightCharles Kenyon is a glorious beacon of lightCharles Kenyon is a glorious beacon of light
Default

Word does not know pages, it forms them on the fly according to the dictates of a printer driver. Therefore, programming pages in vba is an exercise in frustration, at least for me.

How are you marking the beginning/end of your pages?

Why not simply do a replace for empty paragraphs, period?

Properly written, a Word document will not have empty paragraphs.

Pages will begin either when text flows into them (no empty paragraph) or because there was page break before formatting for the first paragraph (heading styles often have this). Again, no empty paragraphs.

Basic concepts of Microsoft Word: An introduction

Understanding Styles in Microsoft Word

Basic Formatting in Microsoft Word
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove unwanted lines - I cannot even find how/where they are inserted! nickib Word 7 08-09-2013 06:01 AM
regular expressions for empty lines eNGiNe Word 1 01-21-2013 06:38 AM
How to remove that pesky empty Page widescreenforever Word 1 11-28-2012 02:49 PM
Deleting empty lines lostsoul62 Word 5 04-16-2012 04:55 AM
how to remove two lines? mryevrah Word 2 05-05-2011 01:41 AM


All times are GMT -7. The time now is 02:17 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft