Results 1 to 6 of 6

Thread: Process not working

  1. #1

    Thread Starter
    Hyperactive Member aks_1610's Avatar
    Join Date
    Sep 2002
    Location
    Pune, India
    Posts
    280

    Unhappy Process not working

    Hi all,

    I am using the following code to open a word file using Process Class :

    VB Code:
    1. Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
    2.  
    3. 'Creating the new instance of a process class
    4. Dim startProg As New Process
    5.  
    6. 'Prividing Application Name and File name to be opened
    7. startProg.StartInfo.FileName = progAssociated
    8. startProg.StartInfo.Arguments = " E:\PROJECTS\VSS22NDCENTURY\DOCUMENTS\Requirement Management\T-SRS-0001-034.doc"
    9.  
    10. Trace.Flush()
    11. startProg.StartInfo.WindowStyle = ProcessWindowStyle.Maximized 'Maximized state
    12.  
    13. 'Starting the Process
    14. startProg.Start()
    15. Trace.Flush()
    16.  
    17. 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...

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Process not working

    So....?

    You haven't told us how you are getting the ProgAssociated value.
    I don't live here any more.

  3. #3

    Thread Starter
    Hyperactive Member aks_1610's Avatar
    Join Date
    Sep 2002
    Location
    Pune, India
    Posts
    280

    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 Attached Images  
    A man with nothing to live for has everything to fight for...

  4. #4
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    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.

  5. #5

    Thread Starter
    Hyperactive Member aks_1610's Avatar
    Join Date
    Sep 2002
    Location
    Pune, India
    Posts
    280

    Re: Process not working

    I've already tried it...
    A man with nothing to live for has everything to fight for...

  6. #6
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196

    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
  •  



Click Here to Expand Forum to Full Width