In today’s article, we would like to present you 2 quick ways to search for Word documents with specific number of pages.
Generally, there are a large number of files stored under one directory. What’s more, there can be various types of files. So, what if you need to search for a Word documents with specific number of pages? Or you happen to forget a document name but remember its total number of pages.
Our solutions bellow will lead you to search for target Word documents with specific number of pages.
Method 1: Search in Window Explorer
- Firstly, click “Start”.
- Then click “Computer” to open the windows explorer. Or if the file explorer icon is already on your taskbar, just click it.
- Next go to the disk and the specific location where you keep all files.
- Now right click on the empty space on the first row.
- Check “Type” and “Pages”. If they are not visible there, click “More” at the bottom of the menu.
- In “Choose Details” box open, check “Pages” and “Type” boxes and click “OK”.
- Then move cursor over “Type” column until the drop-down button shows. Click it.
- Check “Microsoft Word Document” box. You can see only Word documents are left available. Then see the “Pages” column to find the document with specific number of pages.
Method 2: Run Word Macro
- First and foremost, press “Alt+ F11” to invoke VBA editor in Word.
- Next click “Normal” and click “Insert” on the toolbar.
- Choose “Module” to create a new one.
- Then double click to open coding space on the right-hand.
- Paste the following macro there:
Sub FindWordDocumentWithSpecificPageNumber() Dim lPageNumber As Long Dim lSpecificPageNumber As Long Dim strDocList As String Dim strDocName As String Dim objWordApplication As New Word.Application Dim strFile As String Dim strFolder As String strFolder = InputBox("Enter the folder address", "Folder Address", "For example:E:\test word\test\") lSpecificPageNumber = InputBox("Enter the page number you want to search", "Specific Page Number", "For example:1") strFile = Dir(strFolder & "*.doc*", vbNormal) While strFile <> "" With objWordApplication .Documents.Open (strFolder & strFile) lPageNumber = .ActiveDocument.ComputeStatistics(wdStatisticPages) If lPageNumber = lSpecificPageNumber Then strDocName = .ActiveDocument.FullName strDocList = strDocList & strDocName & vbCr End If .ActiveDocument.Close End With strFile = Dir() wend Set objWordApplication = Nothing If strDocList <> "" Then Documents.Add Template:="Normal" ActiveDocument.Range.Text = strDocList Else MsgBox ("There is no match document.") End If End Sub
- Next click “Run” button or hit “F5”.
- Now there is an input box prompting up. Enter the folder address in the text box and don’t forget add “\” at the end of the string.
- Click “OK” to move to next step.
- In the second box, enter a number in its text box. The number indicates the total page of the target document. Similarly, click “OK”.
There will be a document open in Word, with the full name of the target document on it.
Address the Plight of Word Collapse
Generally, Word is a mighty tool to process daily work. Yet, now and then, problems and difficult issues can occur. And sometimes, the situation is a little bit severe that you can end up with damaged word. In such scenario, you are going to need an advanced repairing tool to retrieve your work.
Author Introduction:
Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including xls repair and pdf repair software products. For more information visit www.datanumen.com
Leave a Reply