Results 1 to 9 of 9

Thread: [2005] Open File In Application

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2005
    Location
    Bournemouth
    Posts
    63

    [2005] Open File In Application

    Is there anyway to open a file in an application. So specify the application and then open a file with it?

    Thanks

  2. #2
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: [2005] Open File In Application

    Quote Originally Posted by andyb7901
    Is there anyway to open a file in an application. So specify the application and then open a file with it?

    Thanks
    Open which file in what type of application?
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2005
    Location
    Bournemouth
    Posts
    63

    Re: [2005] Open File In Application

    I have a few files without a file association. If I were to open these through explorer i would associate them with a program called xPrint?

  4. #4
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: [2005] Open File In Application

    So your question is hot to add File Association to a particular type of file using VB 2005? Is that right? You want to do it using the code.
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  5. #5

    Thread Starter
    Member
    Join Date
    Mar 2005
    Location
    Bournemouth
    Posts
    63

    Re: [2005] Open File In Application

    I want to be abale to open a file of my choosing in a specific program using code. So a file named hello (Without any extension) to be opened in xPrint.exe

  6. #6
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: [2005] Open File In Application

    If xPrint application takes command line arguments and the file that you want to open complies with the format of the xPrint application then you can use ProcessStartInfo class to open a specific file with xPrint application
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  7. #7

    Thread Starter
    Member
    Join Date
    Mar 2005
    Location
    Bournemouth
    Posts
    63

    Re: [2005] Open File In Application

    That is what I have managed to sort of get working. I have it working on a C:\hello\hello ( no file extension) file now. However, when i do it on one of my real files it doesnt seem to like spaces. I have the following file to be read into the xPrint file;

    "c:\hello\SUPPLIER NOTIFICATION-3177-0504200747522"

    However it only seems to read NOTIFICATION-3177-0504200747522 and not the Supplier bit before that? any reason why?

    Code:
    Dim MyProcess As New Process
    
    MyProcess.StartInfo.FileName = "C:\xPrint\vpxPrint.exe"
    MyProcess.StartInfo.Arguments = "c:\hello\SUPPLIER NOTIFICATION-3177-0504200747522"
    MyProcess.Start()

  8. #8
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: [2005] Open File In Application

    How about trying it this way?
    vb Code:
    1. Dim MyProcess As New Process
    2.  
    3. MyProcess.StartInfo.FileName = "C:\xPrint\vpxPrint.exe"
    4. MyProcess.StartInfo.Arguments = """c:\hello\SUPPLIER NOTIFICATION-3177-0504200747522"""
    5. MyProcess.Start()
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  9. #9

    Thread Starter
    Member
    Join Date
    Mar 2005
    Location
    Bournemouth
    Posts
    63

    Re: [2005] Open File In Application

    Perfecto!!! Works like a treat! Thanks for all your help!

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