-
December 24th, 2012, 08:59 AM
#1
How to open a file in VB6 using app.Path?
When the button is clicked, I want the file to be opened.
The file will be in the same directory as the visual basic project.
Therefore, I need the code to open the file using "app.Path".
Any solutions?
-
December 24th, 2012, 12:42 PM
#2
Re: How to open a file in VB6 using app.Path?
What kind of file are we talking about?
-
December 24th, 2012, 12:47 PM
#3
Re: How to open a file in VB6 using app.Path?
Originally Posted by dglienna
What kind of file are we talking about?
it's an XPS file (.xps).
When the button is clicked, I want that file to be opened in windows.
-
December 24th, 2012, 02:25 PM
#4
Re: How to open a file in VB6 using app.Path?
You must get the full path of the file, like this
App.Path & "\" & <name.ext>
Once you have it, you can call the ShellExecute API function passing as param the string you got before.
-
December 25th, 2012, 07:41 PM
#5
Re: How to open a file in VB6 using app.Path?
And OPEN will open the text file, but not decode the XML inside of it.
http://www.fileinfo.com/extension/xps
-
December 26th, 2012, 05:37 AM
#6
Re: How to open a file in VB6 using app.Path?
Originally Posted by dglienna
And OPEN will open the text file, but not decode the XML inside of it.
The OPEN argument is not needed and you can also leave a blank string, because the ShellExecute has the open command as default one. See a guide on this API, that provided by AllAPI.net is a very good one.
Enjoy!
Tags for this Thread
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
|