isabelle r
10-26-2017, 12:26 AM
Hello all,
I have a long (about 150 slide) presentation used for interactive educational material, and about 100 of these slides have images (usually screenshots) in the background.
The images are always viewed and copied in the Windows image viewer, then pasted in a specific place in the slide using the small macro below:
Sub Paste_in_Position()
Dim osld As Slide
Set osld = ActiveWindow.Selection.SlideRange(1)
With osld.Shapes.Paste(1)
.Left = 0 * 28.3465 '1 cm=28.3465 pts
.Top = 0.6 * 28.3465 '1 cm=28.3465 pts
.ZOrder msoSendToBack
End With
End Sub
The presentation was so successful it is now being translated to 9 languages, each needing its own version of screenshots in the local language, which even with this macro would require a lot of manual work.
What I'm looking for is to adapt the macro above to do the following:
Go to a folder which I select. The filename of each image is the number of the slide it belongs to (i.e. 3.png goes on slide 3, 46.png goes on slide 46)
Copy an image
Paste the image in its corresponding slide (keep size proportional, but width of the image should fit the width of the slide -- this is automatic when copy-pasting from the Windows image viewer, but I don't know if this is the case when using VBA)
Send the pasted image to the back
Go to the next image and start again until all images in the folder are pasted
I know this may be a tall order, but I'm only asking because I can't find my way around VBA in PPT and because I otherwise have over 900 images to paste manually :banghead:
Thank you for any help,
-Isa
I have a long (about 150 slide) presentation used for interactive educational material, and about 100 of these slides have images (usually screenshots) in the background.
The images are always viewed and copied in the Windows image viewer, then pasted in a specific place in the slide using the small macro below:
Sub Paste_in_Position()
Dim osld As Slide
Set osld = ActiveWindow.Selection.SlideRange(1)
With osld.Shapes.Paste(1)
.Left = 0 * 28.3465 '1 cm=28.3465 pts
.Top = 0.6 * 28.3465 '1 cm=28.3465 pts
.ZOrder msoSendToBack
End With
End Sub
The presentation was so successful it is now being translated to 9 languages, each needing its own version of screenshots in the local language, which even with this macro would require a lot of manual work.
What I'm looking for is to adapt the macro above to do the following:
Go to a folder which I select. The filename of each image is the number of the slide it belongs to (i.e. 3.png goes on slide 3, 46.png goes on slide 46)
Copy an image
Paste the image in its corresponding slide (keep size proportional, but width of the image should fit the width of the slide -- this is automatic when copy-pasting from the Windows image viewer, but I don't know if this is the case when using VBA)
Send the pasted image to the back
Go to the next image and start again until all images in the folder are pasted
I know this may be a tall order, but I'm only asking because I can't find my way around VBA in PPT and because I otherwise have over 900 images to paste manually :banghead:
Thank you for any help,
-Isa