Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read Data From Database :: Find Files :: Print Files - How?

Status
Not open for further replies.

eb24

Programmer
Dec 17, 2003
240
US
I am having a bit of a difficult time trying to figure how to design this DTS package. Here is what I would like my DTS to do:
1. Query database table for FILE_NAME
2. Find FILE_NAME in a directory and its subdirectories.
3. After finding FILE_NAME, Print it.

So far I have this:
Code:
'**********************************************************************
'  Visual Basic ActiveX Script
'************************************************************************

Function Main()

     strDir = "C:\temp" 
     
     Set objFSO = CreateObject("Scripting.FileSystemObject")
     Set objDir = objFSO.GetFolder(strDir)

     Set objShell = CreateObject("Shell.Application")
     Set objFolder = objShell.Namespace(strDir) 
     Set colItems = objFolder.Items

     getInfo(objDir)

     Set objFSO = nothing

     Main = DTSTaskExecResult_Success

End Function

Sub getInfo(pCurrentDir)

     For Each objItem In pCurrentDir.Files
     MsgBox objItem.Name
        If LCase(Right(Cstr(objItem.Name), 3)) = "pdf" Then
   	 'objItem.InvokeVerbEx("Print")
        End If

Next

For Each aItem In pCurrentDir.SubFolders
   MsgBox objItem.Name & " passing recursively"
         
   getInfo(objItem)
      
Next

End Sub
Any and all assistance will be greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top