Change File Extension

G

Guest

Hello,

Access XP and Office XP Object Library

Below is the code I am currently using to use fileDialog to open the dialog
from Access from a command button. The dialog open nicely and I can select
from many files based on my initialfilename.

I would like to continue by copying the selected string as a .txt file and
then moving that new .txt file to my C drive.

Any help would be appreciated.

Private Sub cmdOIDD_Click()

Dim dlgOpen As FileDialog

'Set dlgOpen = Application.FileDialog(msoFileDialogOpen)
Set dlgOpen = Application.FileDialog(msoFileDialogFilePicker)

With dlgOpen
.InitialFileName = "W:\Monthly\????????.CENSUS-UH-NS-SUMMARY-IP.DOC"
.Show
.AllowMultiSelect = False

End With
End Sub

Thanks,
 
K

Ken Snell [MVP]

Check out the FileCopy method in Help file. That copies a file from one
place to another.

To move a file, use the Name method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top