Hi,
I have code thats reading in from a file on my local drive. there are 1000 html pages there and what its doing is its reading them in one by one and then printing them out. I want to add the filepath to the end of each page that it prints so i know what file they are talking about.
can anyone help me with this???? below is the code:
Sub PrintFiles()
'will print all excel files in C:\Data
'By: Ron de Bruin
Dim i As Long
Dim WB As Document
With Application.FileSearch
.NewSearch
.LookIn = "F:\Documents and Settings\Peter\Desktop\Bua Discovery Files" '****Change path here*****
.SearchSubFolders = True
.FileType = msoFileTypeWebPages
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
Set WB = Documents.Open(.FoundFiles(i))
WB.PrintOut Copies:=1
WB.Close False
Next i
End If
End With
End Sub
Thanks for your help
Dee
I have code thats reading in from a file on my local drive. there are 1000 html pages there and what its doing is its reading them in one by one and then printing them out. I want to add the filepath to the end of each page that it prints so i know what file they are talking about.
can anyone help me with this???? below is the code:
Sub PrintFiles()
'will print all excel files in C:\Data
'By: Ron de Bruin
Dim i As Long
Dim WB As Document
With Application.FileSearch
.NewSearch
.LookIn = "F:\Documents and Settings\Peter\Desktop\Bua Discovery Files" '****Change path here*****
.SearchSubFolders = True
.FileType = msoFileTypeWebPages
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
Set WB = Documents.Open(.FoundFiles(i))
WB.PrintOut Copies:=1
WB.Close False
Next i
End If
End With
End Sub
Thanks for your help
Dee