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

Copy File Code

Status
Not open for further replies.

dwilko

Technical User
Feb 20, 2002
113
0
0
GB
Please Can any Give the code for copying a file useing VB's Drive,Dir,file View boxes

Thanks

David

________________________________________
I help Where I can, If My advice Dont work Or Is Wrong then tell Me
 
You can just use FileCopy once you have the path and filename.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Hi dwilko

Not directly related to your question but I find the drive, dir, file view boxes of VB a bit tedious just to select a file on your hard drive somewhere. Plus you don’t get the "My Network Places" option or UNC path capability.

Either that or I just don't know how to do it:)

Depending on your application off course, you might found the CommonDialog control quit useful. It’s the same control (looks the same anyway) as what Office calls when you want to open a file from inside an Office application. You can change the button caption, normally 'Open', to 'Copy' or whatever.

The control doesn't do anything with the selected file. It just gives you the filename and path.

Check your components list for Microsoft Windows Common Controls. I unfortunately can't remember what version but it should be in all since it comes with the Operating system of Windows.

MSDN: "The CommonDialog control provides an interface between Visual Basic and the routines in the Microsoft Windows dynamic-link library Commdlg.dll. To create a dialog box using this control, Commdlg.dll must be in your Microsoft Windows SYSTEM directory."
 
ca8msm
I am New to VB Please Could tell how to use the Filecopy

thanks

David

________________________________________
I help Where I can, If My advice Dont work Or Is Wrong then tell Me
 
Thanks

________________________________________
I help Where I can, If My advice Dont work Or Is Wrong then tell Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top