Change File Extension

  • Thread starter Thread starter Guest
  • Start date Start date
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,
 
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.
 
Back
Top