T
taylorkand
I am new to word vba and need to write a macro that does the
following:
1. Search folder for word files
2. For each file found count the number of pages
3. If the number of pages is odd, print
4. If the number of pages is even, print, but print 2 pages per sheet
I have gotten it to find the files in the folder with the following
code, but I don't know how to do steps 2, 3,4. Please help!
Set fs = Application.FileSearch
With fs
.LookIn = "E:\*****"
.FileType = msoFileTypeWordDocuments
If .Execute > 0 Then
Let counted = .FoundFiles.Count
Else
MsgBox "There were no files found."
End If
End With
following:
1. Search folder for word files
2. For each file found count the number of pages
3. If the number of pages is odd, print
4. If the number of pages is even, print, but print 2 pages per sheet
I have gotten it to find the files in the folder with the following
code, but I don't know how to do steps 2, 3,4. Please help!
Set fs = Application.FileSearch
With fs
.LookIn = "E:\*****"
.FileType = msoFileTypeWordDocuments
If .Execute > 0 Then
Let counted = .FoundFiles.Count
Else
MsgBox "There were no files found."
End If
End With