i want the code to collect from a folder and send it to cdlsave.Dir
1 Code:
  1. Private Sub cmddownload_Click()
  2. Dim strSourceFileName As String
  3. Dim strDestination As String
  4.  
  5. On Error GoTo ERR_Handler
  6.  
  7.  
  8.     strSourceFileName = App.Path & "\server\" & Mid(strSourceFileName, InStrRev(strSourceFileName, "\") + 1)
  9.    
  10.     strDestination = cdlsave.FileName
  11.    
  12.        
  13.     FileSystem.FileCopy strSourceFileName, strDestination
  14.    
  15.     Exit Sub
  16.  
  17. ERR_Handler:
  18.  
  19.     MsgBox "An error has occured while copying file. Operation aborted.", vbExclamation, "File Copy Error"
  20.     Err.Clear
  21.    
  22. End Sub
  23.  
  24. Private Sub cmdsave_Click()
  25.     'upload file link into database
  26.     cdlsave.DialogTitle = "Upload File"
  27.     cdlsave.Filter = "All Files(*.*)|*.*|Office Document 1997-2000(*.doc)|*.doc|Office Document 2003-2010(*.docx)|*.docx|"
  28.     cdlsave.Flags = cdlOFNFileMustExist + cdlOFNPathMustExist
  29.     cdlsave.ShowSave
  30.    
  31.     txtsave.Text = cdlsave.FileTitle
  32. End Sub