简体   繁体   中英

using VBA in Excel to paste into Powerpoint

I am attempting to capture a screenshot from an application I've connected to with VBA in Excel. I want to take a screenshot and paste it into PowerPoint. However, I want to have each screen shot on a new slide.

Dim Pptapp As New PowerPoint.Application
Set pres = Pptapp.Presentations.Add
Dim slidev As PowerPoint.Slide
'(take Screenshot, Don't need code help here)

'need help creating new slide
'need help pasting screenshot on new slide

'I want this to be able to loop through the below items

do until (the end of time)   
    Screenshot    
    new slide    
    paste on new slide     
loop

Dim Pptapp As New PowerPoint.Application
Set pres = Pptapp.Presentations.Add
Dim slidev As PowerPoint.Slide
PrintTheScreen ' function added else where 
Set slidev = pres.Slides.Add(1, PowerPoint.PpSlideLayout.ppLayoutBlank)
slidev.Select
PasteTheScreen ' function added else where 

I needed to do the .Select function to make sure the slide was getting the paste.

Dim Pptapp As New PowerPoint.Application
Set pres = Pptapp.Presentations.Add
Dim slidev As PowerPoint.Slide
PrintTheScreen ' function added else where 
Set slidev = pres.Slides.Add(1, PowerPoint.PpSlideLayout.ppLayoutBlank)
slidev.Select
PasteTheScreen ' function added else where 

I needed to do the .select function to make sure the slide was getting the paste.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM