Mar 31st, 2005, 05:46 AM
#1
Thread Starter
Hyperactive Member
Process not working
Hi all,
I am using the following code to open a word file using Process Class :
VB Code:
Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
'Creating the new instance of a process class
Dim startProg As New Process
'Prividing Application Name and File name to be opened
startProg.StartInfo.FileName = progAssociated
startProg.StartInfo.Arguments = " E:\PROJECTS\VSS22NDCENTURY\DOCUMENTS\Requirement Management\T-SRS-0001-034.doc"
Trace.Flush()
startProg.StartInfo.WindowStyle = ProcessWindowStyle.Maximized 'Maximized state
'Starting the Process
startProg.Start()
Trace.Flush()
Cursor.Current = System.Windows.Forms.Cursors.Default
where progAssociated is coming out to be
"C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE "
ny idea....
Last edited by aks_1610; Mar 31st, 2005 at 05:49 AM .
A man with nothing to live for has everything to fight for...
Mar 31st, 2005, 05:55 AM
#2
Re: Process not working
So....?
You haven't told us how you are getting the ProgAssociated value.
I don't live here any more.
Mar 31st, 2005, 06:18 AM
#3
Thread Starter
Hyperactive Member
Re: Process not working
thanks for the reply,
I've created a module where I pass the file name in a function and the function returns the program associated with the file being passed. The values are coming out with no problems.
In this case:
Wen i try to start my process WORD opens up but it do not open the file and gives the following error(see the file attached).
Attached Images
A man with nothing to live for has everything to fight for...
Mar 31st, 2005, 07:35 AM
#4
Re: Process not working
Try testing the path using File.Exists(path) to see if it exists, (you might want to remove the space character just before "E:\..." in your path string).
I don't live here any more.
Mar 31st, 2005, 08:09 AM
#5
Thread Starter
Hyperactive Member
A man with nothing to live for has everything to fight for...
Mar 31st, 2005, 08:15 AM
#6
Re: Process not working
why not just:
Code:
Process.Start("E:\PROJECTS\VSS22NDCENTURY\DOCUMENTS\Requirement Management\T-SRS-0001-034.doc")
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width