Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
292 views
in Technique[技术] by (71.8m points)

excel - Copy content from powerpoint

I am able to copy the content from powerpoint but getting an error while pasing it on another powerpoint.

Error is on this line

pres2.Slides.Paste Index:=pres2.Slides.Count + 1
Dim OutApp As Object
Dim fileNameString As String
Dim NewSlide As Slide
Dim i As Integer
Dim Nstring As String
Dim Nstring1 As String
Dim Allshape As Object

Dim pres1 As PowerPoint.Presentation, pres2 As PowerPoint.Presentation, pp As Object

On Error Resume Next
Set pp = GetObject(, "PowerPoint.Application")
If Err.Number <> 0 Then Set pp = CreateObject("PowerPoint.Application")
On Error GoTo 0

Set pres1 = pp.Presentations.Open(Sheet1.TextBox1.Text)
Set pres2 = pp.Presentations.Open(Sheet1.TextBox2.Text)

Set NewSlide = pres1.Slides(2)
Set Allshape = NewSlide.Shapes
Allshape.Range.Copy
  
pres2.Slides.Paste Index:=pres2.Slides.Count + 1
question from:https://stackoverflow.com/questions/65897512/copy-content-from-powerpoint

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...