ppt 如何用vba统一设置图片大小 位置 全选图片 全部图片

Sub test()
'获取所有ppt页面
For Each currentSlide In ActivePresentation.Slides

 

'每个页面加一个文本框

Set Sh = currentSlide.Shapes.AddLabel(msoTextOrientationHorizontal, 80, 30, 150, 100)

Sh.TextFrame.TextRange.Text = "如图所示:"
Sh.TextFrame.TextRange.Font.Color = RGB(226, 17, 0)
Sh.TextFrame.TextRange.Font.Size = 24

 '循环每个页面
    For Each shp In currentSlide.Shapes
      'type = 13是图片  17是文本框  
      If shp.Type = 13 Then
       shp.Top = 100 '设置top位置
       shp.Left = 270  '设置left位置
        shp.Height = 400 '设置图片高度位置
        'shp.Width = 7
        End If
    Next shp

Next currentSlide
End Sub

  

posted @ 2022-03-22 12:18  iDEAAM  阅读(1517)  评论(1编辑  收藏  举报