انتقل إلى المحتوى الرئيسي

كيفية إدراج صور متعددة باسم ملف في مستند Word؟

في مستند Word ، يمكنك إدراج صور متعددة بسرعة مرة واحدة باستخدام وظيفة "إدراج". لكن ، في بعض الأحيان ، تحتاج إلى إدراج مسار الملف والأسماء كتسمية توضيحية عند إدراج الصور. كيف يمكنك التعامل مع هذه المهمة في ملف وورد؟

قم بإدراج صور متعددة باسم ملف باستخدام التعليمات البرمجية لـ VBA

قم بإدراج صور متعددة باسم ملف باستخدام كوتولس فور وورد


قم بإدراج صور متعددة باسم ملف باستخدام التعليمات البرمجية لـ VBA

يمكن أن يساعدك رمز VBA التالي على إدراج مسار الملف واسمه كتعليق عند إدراج الصور ، يرجى القيام بذلك على النحو التالي:

1. اضغط باستمرار على ALT + F11 مفاتيح لفتح ميكروسوفت فيسوال باسيك للتطبيقات نافذة.

2. ثم انقر فوق إدراج > وحدة، انسخ والصق الكود أدناه في الوحدة الفارغة المفتوحة:

كود فبا: أدخل عدة صور مع اسم الملف:

Sub PicWithCaption()
    Dim xFileDialog As FileDialog
    Dim xPath, xFile As Variant
    On Error Resume Next
    Set xFileDialog = Application.FileDialog(msoFileDialogFolderPicker)
    If xFileDialog.Show = -1 Then
        xPath = xFileDialog.SelectedItems.Item(1)
        If xPath <> "" Then
            xFile = Dir(xPath & "\*.*")
            Do While xFile <> ""
                If UCase(Right(xFile, 3)) = "PNG" Or _
                    UCase(Right(xFile, 3)) = "TIF" Or _
                    UCase(Right(xFile, 3)) = "JPG" Or _
                    UCase(Right(xFile, 3)) = "GIF" Or _
                    UCase(Right(xFile, 3)) = "BMP" Then
                    With Selection
                        .InlineShapes.AddPicture xPath & "\" & xFile, False, True
                        .InsertAfter vbCrLf
                        .MoveDown wdLine
                        .Text = xPath & "\" & xFile & Chr(10)
                        .MoveDown wdLine
                    End With
                End If
                xFile = Dir()
            Loop
        End If
    End If
End Sub

3. ثم اضغط F5 مفتاح لتشغيل هذا الرمز ، يتم عرض نافذة تصفح ، يرجى تحديد المجلد الذي يحتوي على الصور التي تريد إدراجها ، انظر لقطة الشاشة:

doc إدراج الصور مع اسم الملف 1

4. ثم اضغط OK زر ، تم إدراج جميع الصور الموجودة في المجلد المحدد في مستند Word ، وتم إدراج مسار الملف واسمه كتسمية توضيحية جيدة ، انظر لقطة الشاشة:

doc إدراج الصور مع اسم الملف 2


قم بإدراج صور متعددة باسم ملف باستخدام كوتولس فور وورد

إذا كان لديك كوتولس للكلمة، بما لديها الصور ميزة ، يمكنك إدراج صور متعددة بسرعة مع مسار الملف واسمه في مستند Word على الفور.

كوتولس للكلمة : مع أكثر من 100 وظيفة إضافية مفيدة في Word ، يمكنك تجربتها مجانًا دون قيود في أيام 60. 

بعد تثبيت كوتولس للكلمة، يرجى القيام بذلك على النحو التالي:

1. انقر كوتولس > الصور، انظر لقطة الشاشة:

doc إدراج الصور مع اسم الملف 3

2. في خرجت إدراج الصور مربع الحوار ، يرجى القيام بالعمليات التالية:

  • (1.) انقر إضافة ملفات or إضافة مجلد زر لتحديد الصور التي تريد إدراجها ؛
  • (2.) ثم تحقق أدخل مسار الملف لكل صورة كتعليق الخيار في الجزء السفلي الأيسر من مربع الحوار ؛
  • (3.) ثم انقر فوق إدراج .

doc إدراج الصور مع اسم الملف 4

3. بعد إدراج الصور ، سترى مسار ملف كل صورة واسمها مدرجًا أيضًا ، انظر لقطة الشاشة:

doc إدراج الصور مع اسم الملف 5

انقر لتنزيل Kutools for Word والتجربة المجانية الآن!

أفضل أدوات إنتاجية المكتب

كوتولس للكلمة - ارفع تجربة كلمتك مع أكثر 100 ميزات رائعة!

🤖 مساعد كوتولس AI: تحويل كتابتك باستخدام الذكاء الاصطناعي - توليد المحتوى  /  إعادة كتابة النص  /  تلخيص المستندات  /  الاستفسار عن المعلومات على أساس الوثيقة، كل ذلك داخل Word

📘 إتقان الوثيقة: تقسيم الصفحات  /  دمج المستندات  /  تصدير التحديد بتنسيقات مختلفة (PDF/TXT/DOC/HTML...)  /  دفعة تحويل إلى PDF  /  تصدير الصفحات كصور  /  طباعة ملفات متعددة في وقت واحد

تحرير المحتويات: بحث واستبدال دفعة عبر ملفات متعددة  /  تغيير حجم كافة الصور  /  تبديل صفوف وأعمدة الجدول  /  تحويل الجدول إلى نص

🧹 تنظيف سهل: اكتساح بعيدا مساحات اضافية  /  فواصل القسم  /  كل الرؤوس  /  مربعات النص  /  الارتباطات التشعبية  / لمزيد من أدوات الإزالة، توجه إلى موقعنا إزالة المجموعة

إدراجات إبداعية: إدراج الف فاصل  /  مربعات الاختيار  /  أزرار الراديو  /  رمز الاستجابة السريعة  /  الباركود  /  جدول الخط القطري  /  شرح المعادلة  /  صورة توضيحية  /  الجدول التوضيحي  /  صور متعددة  / اكتشف المزيد في أدخل المجموعة

🔍 التحديدات الدقيقة: يحدد بدقة صفحات محددة  /  الجداول  /  الأشكال  /  فقرات العناوين  / تحسين التنقل باستخدام الأكثر من ذلك حدد الميزات

تحسينات النجوم: انتقل بسرعة إلى أي مكان  /  الإدراج التلقائي للنص المتكرر  /  التبديل بسلاسة بين نوافذ المستندات  /  11 أدوات التحويل

؟؟؟؟ هل تريد تجربة هذه الميزات؟ يقدم Kutools for Word أ الإصدار التجريبي المجاني من 60 يومًا، بلا حدود! 🚀
 
Comments (11)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
VBA CODE IS VERY USEFULLY MY DATA VALIDATE IMAGES SHARING.
This comment was minimized by the moderator on the site
How can I decrease the overall size of the photo so there are multiple per page?
This comment was minimized by the moderator on the site
Is there a way to insert each picture and file name per page? Sometimes if one picture is too big the file name will then go to the next page or if picture is too small the next picture will be together in one page instead on the next page
This comment was minimized by the moderator on the site
Hello, Rizza,
To insert each picture and file name per page, please apply the following vba code:
Sub PicWithCaption()
    Dim xFileDialog As FileDialog
    Dim xPath As String, xFile As String
    On Error Resume Next
    Set xFileDialog = Application.FileDialog(msoFileDialogFolderPicker)
    If xFileDialog.Show = -1 Then
        xPath = xFileDialog.SelectedItems.Item(1)
        If xPath <> "" Then
            xFile = Dir(xPath & "\*.*")
            Do While xFile <> ""
                If UCase(Right(xFile, 3)) = "PNG" Or _
                    UCase(Right(xFile, 3)) = "TIF" Or _
                    UCase(Right(xFile, 3)) = "JPG" Or _
                    UCase(Right(xFile, 3)) = "GIF" Or _
                    UCase(Right(xFile, 3)) = "BMP" Then
                    
                    ' Add the picture
                    Selection.InlineShapes.AddPicture xPath & "\" & xFile, False, True
                    Selection.TypeParagraph
                    
                    ' Add the file path below the picture
                    Selection.TypeText xPath & "\" & xFile
                    Selection.TypeParagraph
                    
                    ' Move to the next page
                    Selection.InsertBreak Type:=wdPageBreak
                End If
                xFile = Dir()
            Loop
        End If
    End If
End Sub


Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
A problem occurs when the file name to be added exceeds 10.

pic1
pic10
pic11
pic12
pic2
pic3
pic4
pic5...
This comment was minimized by the moderator on the site
change the file name to 01, 02, 03 and it will work
This comment was minimized by the moderator on the site
Wow this is great! I only needed the file name, so I deleted "xPath & "\" &" from the .Text line and that worked perfectly. Thanks for this!
This comment was minimized by the moderator on the site
Which line of code would you change and how to have the file path written before the picture, aka the caption (filename) is above rather than below.
This comment was minimized by the moderator on the site
With Selection
.Text = xFile
.InlineShapes.AddPicture xPath & "\" & xFile, False, True
.InsertAfter vbCrLf
.MoveDown wdLine

End With
This comment was minimized by the moderator on the site
Have to add this .MoveDown wdLine after .Text=xFile
This comment was minimized by the moderator on the site
buenas noches amigo me ha servido mucho su información sinembargo me surge una duda cree que es posible incertar imagenes en word de la misma manera pero dentro de celdas incertadas?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations