VBA批量导入多个文件夹下的图片到PPT

本文介绍了如何使用VBA编程自动化地将多个文件夹下的图片批量导入到PowerPoint演示文稿中,提升工作效率。
摘要由CSDN通过智能技术生成

1.需要导入到PPT的照片文件夹
要导入的图片文件夹列表

  1. Coding
Sub InsertPicture()
Dim oPPT As Presentation
Dim oSlide As Slide
Dim nSlide As Byte
Dim oCL As CustomLayout
Dim Shp As Shape
Dim myFile
Dim filearr()
Dim filearr0()
Dim myPath As String
Dim sPath As String
Dim FileName As String
Dim files As String
Dim x As String
Set oPPT = PowerPoint.ActivePresentation
'sPath = "C:\Users\Desktop\VBA\Outbound Loading Audit 10.31\"
    
With oPPT
nSlide = .Slides.Count
    With oSlide
    
       For j = 2 To nSlide
            Set oSlide = ActivePresentation.Slides(j)
            oSlide.Select  '选定当前ppt
            '以上为遍历每个PPT
'-------------------------------------------------------------------------------------------

                myPath = Dir("C:\Users\jishen\Desktop\VBA\Outbound Loading Audit 10.31\", vbDirectory)   'vbDirectory只看文件夹
                Do While myPath <> ""
                    ReDim Preserve filearr0(k)
                    filearr0(k) = Split(myPath 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值