首页 文章

Powerpoint VBA - 将文本框和文本复制到所有幻灯片(没有选择)

提问于
浏览
0

我正在自动化一些数据输出功率点,我需要一个脚本,将所有带有文本的文本框复制到所有幻灯片,我还需要指定方向(左/上/宽/高) . 我正在设置第一张幻灯片,并希望它以完全相同的方向复制到100张幻灯片 .

我能够找到以下代码:

Dim oSh As Shape Dim x As Long

Set oSh = ActiveWindow.Selection.ShapeRange(1)

 For x = 2 To ActivePresentation.Slides.Count
     oSh.Copy
     ActivePresentation.Slides(x).Shapes.Paste
 Next

但它要求我选择文本框,这不是我想要的 . 我搜索过但似乎无法找到我想要的东西 .

谢谢 !

1 回答

  • 0
    'Set oSh = ActiveWindow.Selection.ShapeRange(1)
    Set oSh = ActivePresentation.Slides(1).Shapes(n)
    ' You'll need to work out the value of n for your particular slide layout
    
     For x = 2 To ActivePresentation.Slides.Count
         oSh.Copy
         ActivePresentation.Slides(x).Shapes.Paste
     Next
    

相关问题