使用VBA(PPT)将形状移动到下一张幻灯片

使用VBA(PPT)将形状移动到下一张幻灯片,vba,excel,powerpoint,Vba,Excel,Powerpoint,首先,我是VBA新手 我想将形状从一张幻灯片移动到下一张幻灯片。我想为演示文稿的每张幻灯片都这样做。(在编辑模式下) 这是我目前掌握的代码。在同一张幻灯片中移动形状是可行的,但我真的不知道在下一张幻灯片中添加什么来移动形状 提前感谢您的帮助。这里有一个小片段应该会有所帮助: ' Copy the shape to the clipboard: Shp.Copy ' Paste the shape to the next slide ' Shp.Parent gives you a refere

首先,我是VBA新手

我想将形状从一张幻灯片移动到下一张幻灯片。我想为演示文稿的每张幻灯片都这样做。(在编辑模式下)

这是我目前掌握的代码。在同一张幻灯片中移动形状是可行的,但我真的不知道在下一张幻灯片中添加什么来移动形状


提前感谢您的帮助。

这里有一个小片段应该会有所帮助:

' Copy the shape to the clipboard:
Shp.Copy

' Paste the shape to the next slide
' Shp.Parent gives you a reference to the slide the shape is on
' Shp.Parent.SlideIndex + 1 gives you a reference to the NEXT slide
ActivePresentation.Slides(Shp.Parent.SlideIndex + 1).Shapes.Paste

' And delete the original shape
Shp.Delete
当然,你需要确保真的有下一张幻灯片。ActivePresentation.Slides.Count将告诉您有多少张幻灯片

' Copy the shape to the clipboard:
Shp.Copy

' Paste the shape to the next slide
' Shp.Parent gives you a reference to the slide the shape is on
' Shp.Parent.SlideIndex + 1 gives you a reference to the NEXT slide
ActivePresentation.Slides(Shp.Parent.SlideIndex + 1).Shapes.Paste

' And delete the original shape
Shp.Delete