Using a CommonDlg Box to Copy and Link a file

getout

New member
Local time
Today, 01:21
Joined
Feb 11, 2009
Messages
4
Here's the idea: I've been trying to figure out how to use a CommonDlg to Copy a file from a location on a user's computer to a center file system on the server, then link to that file in a list box (from a table).

Any suggestions would be great. I've seen people embed pictures and link other files but not copy and link.

Any help would be much appreciated.
 
***This requires a reference to Microsoft 11.0 Office Library***

Dim sConxString As String

'Open a dialog box and get a filename for the data database.
Set dlgOpen = Application.FileDialog(msoFileDialogOpen)
With dlgOpen
.Title = "Open an Access database to connect to"
.Filters.Add "Access Databases", "*.mdb;*.mde", 1
.AllowMultiSelect = False
.Show
End With
'Returns the table connection file path string.
sConxString = dlgOpen.SelectedItems.Item(1) 'Can only be item 1.

This code pulls up an Access Database. You can change that by adding "*.xls;*.txt" or what ever you want for a file extension for your file name.

Then use FileCopy from Windows or FileSystemObject from referencing the Tools,References from that.

Good Luck:)
--Craig
 
I think I must be CommonDlg Box illiterate because I can't make it do anything once it's open. The CommonDlg opens, but it doesn't actually do anything. Any place I can go for a CommonDlg crash course?
 

Users who are viewing this thread

Back
Top Bottom