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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using Dir function parameters?

Status
Not open for further replies.

Luis939

MIS
Feb 28, 2003
453
US
hey if i have these statements:

MyFile = Dir("C:\", vbNormal)

is there anyway where i can just use the path again but refering it as the first parameter of Dir. If i have a very long path, i wouldnt want to write it out again, is there a simple of way of just using whatever is the first argument for the Dir function? thanks!!
 
why not just assign it to a string variable ???

dim mPath as string

mPath = "C:\Home\My Docs\This\And\That\Stuff\"

then you can use
MyFile = Dir(mPath, vbNormal)
and use mPath to refer to that path for the rest of the procedure

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top