VBdotnet2005
asked on
Print in VB2005
Is there a shorter or a different way to print every files in a folder in VB2005?
Private Sub btnPrintCogentPDF_Click(By Val sender As System.Object, ByVal e As System.EventArgs) Handles btnPrintCogentPDF.Click
Dim myProcess As New Process
Dim myFileinfo As FileInfo
Dim myDir As DirectoryInfo = New DirectoryInfo("G:\MailBox\ Attach\sam ple")
'Dim i As Integer
'i = 1
For Each myFileinfo In myDir.GetFiles()
'i += 1
'If myFileinfo.Extension = ".pdf" Then
myProcess.StartInfo.FileNa me = myFileinfo.FullName
myProcess.StartInfo.Verb = "print"
myProcess.Start()
'End If
Next
End Sub
Private Sub btnPrintCogentPDF_Click(By
Dim myProcess As New Process
Dim myFileinfo As FileInfo
Dim myDir As DirectoryInfo = New DirectoryInfo("G:\MailBox\
'Dim i As Integer
'i = 1
For Each myFileinfo In myDir.GetFiles()
'i += 1
'If myFileinfo.Extension = ".pdf" Then
myProcess.StartInfo.FileNa
myProcess.StartInfo.Verb = "print"
myProcess.Start()
'End If
Next
End Sub
ASKER
I believe it is 7.1
Here is a little code that makes searching faster:
For Each myFileinfo In myDir.GetFiles("*.pdf")
Bob
For Each myFileinfo In myDir.GetFiles("*.pdf")
Bob
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Bob