|
-
May 31st, 2007, 07:25 AM
#1
Thread Starter
Member
[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
-
May 31st, 2007, 07:29 AM
#2
Re: [2005] Open File In Application
 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
-
May 31st, 2007, 07:30 AM
#3
Thread Starter
Member
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?
-
May 31st, 2007, 07:38 AM
#4
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
-
May 31st, 2007, 07:47 AM
#5
Thread Starter
Member
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
-
May 31st, 2007, 07:53 AM
#6
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
-
May 31st, 2007, 08:09 AM
#7
Thread Starter
Member
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()
-
May 31st, 2007, 08:16 AM
#8
Re: [2005] Open File In Application
How about trying it this way?
vb Code:
Dim MyProcess As New Process
MyProcess.StartInfo.FileName = "C:\xPrint\vpxPrint.exe"
MyProcess.StartInfo.Arguments = """c:\hello\SUPPLIER NOTIFICATION-3177-0504200747522"""
MyProcess.Start()
Use [code] source code here[/code] tags when you post source code.
My Articles
-
May 31st, 2007, 08:21 AM
#9
Thread Starter
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|