February 20, 2007 at 2:56 pm
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:
'**********************************************************************
' 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.
February 20, 2007 at 7:51 pm
Since you're trying to print a PDF file, is Acrobat Reader or a print driver for PDF's installed on the server?
--Jeff Moden
Change is inevitable... Change for the better is not.
February 21, 2007 at 8:49 am
My question, is not so much about printing PDFs - this functionality works fine. I am more concerned about:
Thanks for your asssistance!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply