Avatar of rrhandle8
rrhandle8
Flag for United States of America asked on

Word VBA Delete pages with only a "Page Break"

I generate multiple page document, and must enter Page Breaks at certain points.  Sometimes the end result is a document with some blank pages that contain only a Page Break.  I need to delete those pages.
Is there a way to read the top line of each page so I can test if it is a page break? Or can I grab the contents of a page, and if the contents are only 2 characters long (the is the number of characters for a page page), then delete the Page Break?
Open to suggestions.
VBAMicrosoft Word

Avatar of undefined
Last Comment
Martin Liss

8/22/2022 - Mon
Bill Prew

Please upload a sample Word document with the situation.


»bp
rrhandle8

ASKER
See attached
Table1.docx
ASKER CERTIFIED SOLUTION
Martin Liss

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
rrhandle8

ASKER
Worked great.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Martin Liss

Again, glad I could help.