I need to open several pdf, word and excel files from process.start like command, but only open one file at time.
+2
A:
You can use WaitForExit with a process to pause execution until the application that handles the pdf, word, etc. file is closed. This will work if the user closes, for example, word instead of closing only the word document and leaving the word application running.
Dim proc As Process
proc = Process.Start("c:\tmp.jpg")
proc.WaitForExit()
proc = Process.Start("c:\tmp1.jpg")
proc.WaitForExit()
xpda
2009-10-25 18:25:47
A:
Its work without "proc.WaitForExit()", I can get several documents open at the same time with the following code:
Private Sub OpenDocument(ByVal strDocName as String)
Dim proc as Process
proc = Process.Start(strDocName)
End Sub
Bitnius
2009-10-25 22:49:08
I thought you only wanted to open one at a time.
xpda
2009-10-26 04:10:09
"I need to open several pdf, word and excel files"
Bitnius
2009-10-26 05:20:26