1 Replies - 3230 Views - Last Post: 06 October 2009 - 05:12 AM Rate Topic: -----

#1 renmee  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 155
  • Joined: 20-July 09

Copy and rename file to path

Posted 06 October 2009 - 12:58 AM

the file being saved is corrupted pls help
Private Sub cmdMC_Click()
Dim mystring As String
Dim myst As String
Dim fso As New FileSystemObject, iCtr As Integer, node As String
Dim ServerPath, fileExt As String, Extension, FileName As String
Dim frmstring As String


Extension = Split(GetIniFileVal("Program", "EXTENSION"), ",")
ServerPath = GetIniFileVal("Program", "PATH")
node = GetData("Select EmpChildrensBC from HR_TBL_DOCUSUBMITTED")

On Error GoTo DialogError
With cdialog1
.InitDir = "C:\Documents and Settings\rcaluag\My Documents"
.CancelError = True
.Filter = "PDF Files (*.pdf)|*.pdf"
.FilterIndex = 1
.DialogTitle = "Select a file to copy"
.Flags = cdlOFNOverwritePrompt ' overwrite prompt
.ShowOpen

MsgBox "You have selected " & .FileName

.InitDir = "\\DCC_SVR\HRIS$\MC\"
.FileName = Text1.Text
.CancelError = True
.Filter = "PDF Files (*.pdf)|*.pdf"
.FilterIndex = 1
.DialogTitle = "Save to this location"
.ShowSave
mystring = Trim$(cdialog1.FileName)
frmstring = "C:\Documents and Settings\rcaluag\My Documents\TEST.pdf" & FileName

MsgBox Text1.Text & "Saved"

Text1.Text = mystring
fso.CopyFile frmstring, cdialog1.FileName, False
Set fso = Nothing
End With
DialogError:
End Sub



Is This A Good Question/Topic? 0
  • +

Replies To: Copy and rename file to path

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6107
  • View blog
  • Posts: 23,659
  • Joined: 23-August 08

Re: Copy and rename file to path

Posted 06 October 2009 - 05:12 AM

Are you sure you want to do this?

frmstring = "C:\Documents and Settings\rcaluag\My Documents\TEST.pdf" & FileName

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1