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:
Any and all assistance will be greatly appreciated.
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