السلام عليكم
اخواني هذا الكود تعبني اهواي كل ما اريد احولة من نسخ الى نقل ما دا اكدر / اساتذتي هذا الكود يعمل نسخ ملف ال pdf من ملفات الحاسوب الى المجلد A ضمن فولدر قاعدة البيانات (طلب) اني اريد تعديل على الكود من نسخ الى نقل او قص ال pdf حتى بعد اختيار الملف ينحذف من المجلد ويذهب الى المجلد الجديد A ضمن فولدر قاعدة البيانات
On Error GoTo err:
Dim fso As Object
Set fso = CreateObject("scripting.filesystemobject")
Dim fDialog As Office.FileDialog
Dim varFile As Variant
Dim destpath As Variant
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
With fDialog
.AllowMultiSelect = False
.Title = "Please select one image"
.Filters.Clear
If .Show = True Then
.Filters.Add "png image", "*.png"
.Filters.Add "jpg image", "*.jpg"
.Filters.Add "jpeg image", "*.jpeg"
.Filters.Add "All Files", "*.*"
For Each varFile In .SelectedItems
destpath = Application.CurrentProject.Path & "\" & "A" & "\" & Me.Id & "f." & Right$(varFile, Len(varFile) - InStrRev(varFile, "."))
FileCopy varFile, destpath
Me.s = destpath
Next
Else
MsgBox "You clicked Cancel in the file dialog box."
End If
End With
Exit Sub
err:
MsgBox err.Description & " " & err.Number