Link to home
Start Free TrialLog in
Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America

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(ByVal 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\sample")

        'Dim i As Integer
        'i = 1


        For Each myFileinfo In myDir.GetFiles()
            'i += 1
            'If myFileinfo.Extension = ".pdf" Then

                myProcess.StartInfo.FileName = myFileinfo.FullName
                myProcess.StartInfo.Verb = "print"
                myProcess.Start()

               

            'End If
        Next



    End Sub
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

What version of Acrobat do you have?

Bob
Avatar of VBdotnet2005

ASKER

I believe it is 7.1
Here is a little code that makes searching faster:

For Each myFileinfo In myDir.GetFiles("*.pdf")

Bob
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial