Hi, 

 

  I would probably use the FileScriptingObject in VB.

 

You will need to add a reference to the Microsoft Scripting Runtime and do 
something like this

 

Public Function CheckForFiles()

 

Dim fso as new FileSystemObject

Dim oFolder as folder

Dim oFile as file

 

Set oFolder = fso.GetFolder("{Source Folder}")

 

For each oFile in oFolder.Files

 

' here you can check to see if the filename matches some criteria such as :

 

                If ofile.name = "somename.pdf" then....

 

                Or

 

                If instr(1,ucase(ofile.name),"PDF")  then .....

                

                

 

                And then you can copy, move, delete ...etc

 

                Ofile.move("{Destination Folder}")

                Ofile.Copy("{Destination Folder}",{Boolean to force overwrite})

                Ofile.Delete, {Boolean to force delete}

 

Next oFile

 

Set oFolder = nothing

Set oFile = nothng

 

End Function

 

Check out the FileSystemObject, there are a lot of other cool things you can do 
with it.

 

Tim

 

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lawrence, 
Mitchell
Sent: Thursday, August 30, 2007 9:10 AM
To: [email protected]
Subject: [Talk] Method to watch a directory for a specific file
Importance: High

 

Is there a rules-based (or nice polished vba function) method for watching a 
specific directory for a specific file?

 

I would like to incorporate printing to PDF from Meditech into our scripting 
capabilities. I can do this by creating a pdf printer driver (we have full 
adobe) that always prints to a specified directory, specified file. During the 
creation of a PDF, adobe uses a .tmp file, once the creation of the document is 
finished, adobe renames the .tmp file to the actual PDF.

 

If I was able to "watch" the output directory for the file, I could then pick 
that file up and move it to the proper destination/proper name, and then close 
out the script.

 

So I would also need some way to turn off the timeout in BWS, as each file may 
take some time to create and would be variable.

 

Anyone have any ideas for these two things? 

 

*       Watching a directory for a specified file (likely a vba 
function/subroutine)
*       Turning off the timeout in BWS?

 

Thank you,

Mitch Lawrence

Lead Applications Analyst

Technical Support - NPR/Automation

CHRISTUS Information Management

™: [EMAIL PROTECTED]

 

 

Send a "thank you" <http://intranet.christushealth.org/spiritBuck/>  to someone!

 



CONFIDENTIALITY NOTICE: This message and any included attachments are from 
Salinas Valley Memorial Hospital and are intended only for the addressee. The 
information contained in this message is confidential and may constitute inside 
or non-public information under international, federal, or state securities 
laws. Unauthorized forwarding, printing, copying, distribution, or use of such 
information is strictly prohibited and may be unlawful. If you are not the 
addressee, please promptly delete this message and notify the sender of the 
delivery error by e-mail or you may call Salinas Valley Memorial Healthcare 
System's Privacy Officer in Salinas, California, U.S.A at (+1) (831) 755-0751.

<<image001.jpg>>

Reply via email to