Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-25-2015, 10:38 PM
ndandge ndandge is offline Find and list Blank pages in Word document. Windows 7 64bit Find and list Blank pages in Word document. Office 2007
Novice
Find and list Blank pages in Word document.
 
Join Date: Nov 2015
Posts: 8
ndandge is on a distinguished road
Post Find and list Blank pages in Word document.


Hi! I need to write macro to find all blank pages and create list of them at the end of the document or in new document. Could anybody help me?
Reply With Quote
  #2  
Old 11-26-2015, 12:35 AM
macropod's Avatar
macropod macropod is offline Find and list Blank pages in Word document. Windows 7 64bit Find and list Blank pages in Word document. Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Why does your document have blank pages? How are they generated (e.g. via Odd/Even Next page Section breaks, or by some other method)?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 11-26-2015, 10:54 PM
ndandge ndandge is offline Find and list Blank pages in Word document. Windows 7 64bit Find and list Blank pages in Word document. Office 2007
Novice
Find and list Blank pages in Word document.
 
Join Date: Nov 2015
Posts: 8
ndandge is on a distinguished road
Default

These documents have thousands of Tables and Figures. Tables and Figures are separated by Section Breaks. Sometimes only Section break appears on the page, and that creates blank page in document.

Yes, Blank pages are generated by 'Next page Section breaks'. However they are not on odd\even page always. Interval of blank pages is not fixed.

Last edited by ndandge; 11-27-2015 at 02:09 AM.
Reply With Quote
  #4  
Old 11-27-2015, 03:09 AM
macropod's Avatar
macropod macropod is offline Find and list Blank pages in Word document. Windows 7 64bit Find and list Blank pages in Word document. Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Try:
Code:
Sub Demo()
Dim i As Long, Rng As Range, StrPages As String
With ActiveDocument
  For i = 1 To .ComputeStatistics(wdStatisticPages)
    Set Rng = .GoTo(What:=wdGoToPage, Name:=i)
    Set Rng = Rng.GoTo(What:=wdGoToBookmark, Name:="\page")
    If Len(Rng) < 3 Then StrPages = StrPages & " " & Rng.Information(wdActiveEndAdjustedPageNumber)
  Next
End With
StrPages = Replace(Trim(StrPages), " ", ", ")
MsgBox "The following pages are empty:" & vbCr & StrPages
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 11-29-2015, 09:15 PM
ndandge ndandge is offline Find and list Blank pages in Word document. Windows 7 64bit Find and list Blank pages in Word document. Office 2007
Novice
Find and list Blank pages in Word document.
 
Join Date: Nov 2015
Posts: 8
ndandge is on a distinguished road
Thumbs up

Thank you so much!

It worked. Its really helping me.

Thanks once again.
Reply With Quote
Reply

Tags
word 2007, word vba macro

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
can word: make variables, find appropriate pages, fill out pages with variables, print only those 20GT Word VBA 1 10-15-2014 09:48 PM
Removing blank pages at the end of a document Xanzia Word 3 06-01-2014 11:13 AM
Word and other word processors print blank pages jrasicmark Word 5 05-28-2014 03:10 PM
Find and list Blank pages in Word document. Unable to retain section page numbering while removing the blank pages in MS word 201 ramsgarla Word 3 10-01-2012 03:52 AM
delete blank pages from mail merge document blusea Word 0 12-17-2010 06:10 PM

Other Forums: Access Forums

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