Advertisement

04.09.2008 at 03:07AM PDT, ID: 23307577
[x]
Attachment Details

System.Diagnostics.Process.Start not opening the PDF document

Asked by imrancs in Visual Studio .NET 2003, Windows XP Operating System, Adobe Acrobat

Tags: Microsoft, Dot Net, 1.1, Windows XP Dot Net 1.1 ShellExecute, Visual Basic.Net, C#, Internet Explorer 6.0.2900, system cannot find the file specified, Windows Forms ProcessStartInfo System.Diagnostics.Process.Start()

I am using Dot Net 1.1 win form based application on Windows XP SP2.
Code is written on VB.Net but does not matter can be done with any dotnet language.

System.Diagnostics.Process.Start not opening the PDF document on one client machine.
Adobe Acrobat PDF reader 8.0 is installed on all client machines.

Same code is able to open other files like jpg, bmp, doc, xls...
I doubt if .pdf is not associated with the acrobat on the windows but it is also fine.
If I open the PDF file directly by double clicking it, it is opening, working fine.
A year ago or bit less earlier Acrobat 7 and earlier Acrobat 5 was also installed but then later all uninstalled and now is only Adobe Acrobat 8.0
The path of the file itself is perfectly fine, the problem is not with the spaces in the path of file name.
Same thing is working on all client machine but not on one machine.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
Public Sub OpenDocument(ByVal FilePath As String, Optional ByVal bUseShellExec As Boolean = True, Optional ByVal bPrint As Boolean = False)
		'MsgBox(FilePath)
 
		Dim Print As New System.Diagnostics.ProcessStartInfo
		'Verb is being always used as "open"
		If bPrint = False Then
			Print.Verb = "open"
		Else
			Print.Verb = "Print"
		End If
		Print.WindowStyle = ProcessWindowStyle.Maximized
		Print.FileName = FilePath
		Print.UseShellExecute = bUseShellExec
		Try
			System.Diagnostics.Process.Start(Print)
		Catch ex As System.ComponentModel.Win32Exception
			MsgBox(ex.Message & vbCrLf & ex.StackTrace)
		End Try
	End Sub
[+][-]04.13.2008 at 12:23AM PDT, ID: 21343961

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.13.2008 at 02:03AM PDT, ID: 21344138

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.13.2008 at 02:30AM PDT, ID: 21344195

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Studio .NET 2003, Windows XP Operating System, Adobe Acrobat
Tags: Microsoft, Dot Net, 1.1, Windows XP Dot Net 1.1 ShellExecute, Visual Basic.Net, C#, Internet Explorer 6.0.2900, system cannot find the file specified, Windows Forms ProcessStartInfo System.Diagnostics.Process.Start()
Sign Up Now!
Solution Provided By: sramesh2k
Participating Experts: 1
Solution Grade: B
 
 
[+][-]04.15.2008 at 01:33AM PDT, ID: 21356900

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.15.2008 at 07:00AM PDT, ID: 21358731

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628