اذهب الي المحتوي
أوفيسنا

اريد عند اختيار مسار الصورة يتم نسخ الصورة إلى مجلد


Hamtoooo
إذهب إلى أفضل إجابة Solved by ابوخليل,

الردود الموصى بها

السلام عليكم 

لدي نموذج فيه التالي :

image.png.8c9214ee798d58b1d73660c86e970beb.png

اريد عند ارفاق مسار الصورة يتم نسخ الصورة وحفظها في مجلد IMAGE  الموجود بجانب القاعدة ..

إليكم المرفق ..

 

123456.rar

شكرا لكم 
 

رابط هذا التعليق
شارك

تفضل

Dim SourceFile, DestinationFile
Dim ons As String
ons = [id_Flightpermits_lab]
SourceFile = filepath_att
DestinationFile = CurrentProject.Path & "\image\" & ons & ".jpg"
FileCopy SourceFile, DestinationFile
[link_file] = DestinationFile

 

 

Downloads.rar

  • Thanks 1
رابط هذا التعليق
شارك

احسن الله إليك ابو خليل اجابه كافيه ووافيه 
ماذا لو اردت ان اجعل المرفق يقبل تنسيق الصور وال PDF معا
الكود يعمل على الصور فقط

رابط هذا التعليق
شارك

  • أفضل إجابة

يصبح الكود هكذا

Dim ons As String
Dim typefld As String
ons = [id_Flightpermits_lab]
SourceFile = filepath_att
typefld = Right(SourceFile, Len(SourceFile) - InStrRev(SourceFile, "."))
DestinationFile = CurrentProject.Path & "\image\" & ons & "." & typefld
FileCopy SourceFile, DestinationFile
[link_file] = DestinationFile
MsgBox "تم النسخ بنجاح"

 

قاعدة2.rar

  • Thanks 1
رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information