0

Hiya, whnever I use this code, I get a File Not Found exception, even though the file paths are all correct. Any ideas? thanks

Dim WordReader As String = "C:\Program Files\Microsoft Office\Office10\WINWORD.exe"
Dim HelpPath As String = "C:\Documents and Settings\Steven\Desktop\TPBData\Help.doc"
        
        Shell(WordReader & HelpPath & "" & AppWinStyle.MaximizedFocus)
2
Contributors
3
Replies
5
Views
6 Years
Discussion Span
Last Post by kronald
0

I tried it on my computer and got the same result file not found. This works:

Dim Proc As Process = System.Diagnostics.Process.Start(HelpPath)
0

I tried it on my computer and got the same result file not found. This works:

Dim Proc As Process = System.Diagnostics.Process.Start(HelpPath)

That's great! Works fine, and now the program doesn't need to specify the program filepaths. Thanks a lot

0

Got it, You need quotes around the two paths ....

Dim WordReader As String = Chr(34) & "C:\Program Files\Microsoft Office\Office10\WINWORD.exe " & Chr(34)
Dim HelpPath As String = Chr(34) & "C:\Documents and Settings\Steven\Desktop\TPBData\Help.doc" & Chr(34) 
Dim r As Integer = shell(WordReader & HelpPath, AppWinStyle.MaximizedFocus)
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.