Powerpoint VB Screenshot

shaon0

Board Regular
Joined
Jan 16, 2013
Messages
167
Hi guys,

I'm trying to take screenshots of certain slides from certain files and copy/paste them into a new powerpoint file.

I think it might go along the lines of:
Code:
Sub InsertAndSizePicture()

    Dim oPicture1, oPicture2, oPicture3, oPicture4 As Shape
    Dim FullPath1, FullPath2, FullPath3, FullPath4 As String
    Dim oSl1, oSl2, oSl3, oSl4 As Slide


    FullPath1 = "R:\Produced\E" & <name> & "<some other string>" '(only the <name> bit will change from each process)


    Set oSl1 = [Slide 2 from the file]


    Set oPicture1 = oSl1.Shapes.AddPicture(FileName:=FullPath, _
       LinkToFile:=msoFalse, _
       SaveWithDocument:=msoTrue, _
       Left:=0, Top:=0, _
       Width:=100, Height:=100)


    ' Rescale the picture to its "natural" slze
    With oPicture1
       .ScaleHeight 1, msoTrue
       .ScaleWidth 1, msoTrue
    End With

...


End Sub

If there are any experts out there who can figure this out. I would be really appreciative :)

Thanks in advanced.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
FullPath1 = "R:\Produced\E" & <name> & "<some other="" string="">" '(only the <name> bit will change from each process) should be:
FullPath1 = "R:\Produced\E\" & [Name]<name> & "[some string]<some other="" string="">" '(only the [Name]<name> bit will change from each process)

Any help would be highly appreciated :)</name></some></name></name></some></name>
 
Upvote 0
You can export a needed slide to a image file (like screenshot) using
Code:
Application.ActivePresentation.Slides(1).Export "d:\path\filename.png","PNG"
And what is that about Excel?
Regards
 
Upvote 0
Thank you for your help anvg. The real problem is that the files aren't all .ppt. I need to copy images from two .pdf, one .xls and one .png file. Each of these are in documents which are all in different path locations.

This seems like a very difficult program to write in VB.
 
Upvote 0
I am sorry. I can not help you with .pdf files. I erroneously understood your "to take screenshots of certain slides from certain files" as .ppt files.
 
Upvote 0

Forum statistics

Threads
1,214,657
Messages
6,120,764
Members
448,991
Latest member
Hanakoro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top