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

Getting a full FilePath from a user

Status
Not open for further replies.

paulo33

Technical User
Oct 31, 2002
15
0
0
AU
Does anybody know how to get a valid, full filepath from a user. i.e. Getting the user to browse through the 'SaveAs' dialog box, chose an appropiate file, and that the chosen file is returned as a full-filepath, not just a file name.

thanks
 
What program are you working with?

The easiest way to get a filename is to use the MSComDlg.ocx CommonDialog control which returns a 'FileName' containing the full path and file name the user selected.

If you're trying to use office automation then you can capture events by using a class module.

Give us a little more info.
VBSlammer
redinvader3walking.gif

Unemployed in Houston, Texas
 
Both the Application.GetSaveAsFilename and Application.GetOpenFileName methods return the full path, and are very easy to use. I don't know if they are available in every VBA-enabled application, but they should be there in all MSOffice applications.
Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top