how to access a file only with the relative path?
I would like to know if someone can help me about "relative path" topic??
I am buiding an application in word with macros and hiperlinks to VB. The application is supposed to work on a dinamic way so it should work in any directory is activated. But actually I have not discovered any way to make reference to relative path in VB6. I have seen the function "GetByRelativePath" but I really do not know how to used it.
[426 byte] By [
ihateVB] at [2007-11-11 10:16:42]

# 2 Re: how to access a file only with the relative path?
I don't know what do you want exactly
but (for example)
if your app is located in C:\MyApp and it writes to a file named "settings.ini" in its directory you can use the following (for example):
Open "settings.ini" for append as #1
print #1, MyData
close #1
or
if len(app.path)> 3 then E = "\" else E = ""
Open app.path & E & "settings.ini" for append as #1
print #1, MyData
close #1
if your file is in a sub-directory Data :
you can use
if len(app.path)> 3 then E = "\" else E = ""
Open app.path & E & "data\settings.ini" for append as #1
print #1, MyData
close #1
you can use "..\settings.ini" to access the parent directory
in this case it is C:\
i wish that I understood what you want