Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open File in Current Directory

Status
Not open for further replies.

Mungovan

Programmer
Oct 24, 2002
94
IE
Hi.
I have a VB project that's located at C:\Documents and Settings\Owner\Desktop\Project.

I need to access a html file that will always be located in the same folder as the project.

However, I want the folder to be portable to other machines (that is, it may not always be located at the above path e.g c:\Project.

One of my comands is to output data to the html file and the code looks like this:
Open "C:\Documents and Settings\Owner\Desktop\Project\Print.html" For Output As ff

How can I make this a statement saying that the location is in the same folder as the project, but may have any path??

Can this be done?

Thanks,
D
 
Hello

Please use App.Path to get the cussrent application folder.

U can code as App.path & &quot;\&quot; & <filename>

Regards
Soumya
 
Cool, got it working in the code.

On a similar note:
I need to do something similar but in relation to the help file when F1 is pressed.
The path to the help file is placed in:project > Project Properties, and then enter the path of the .chm help file.

The app.path declaration doesn't work for this however.

Any ideas?

Thanks,
D


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top