I want to paste images from a directory into PowerPoint then resize them.
I have 16 images all in one directory which need updating each month. The task is:
- Open directory
- Open first image
- Paste image into PowerPoint
- Reposition image to top left
- Resize image to height 550 by width 960 (fills A4 page)
- Send image to back
- Move to next slide
- Repeat for second image
- Continue until no more images in directory
Directory is (e.g.) "C:\Users\xxxxxx\Documents\Work\Procurement Project\Slides"
First image name is (e.g.) "01 Summary", second is "02 Client Contracts" etc.
I think I need a str and a path and a table for the str to add to path to create each new path using i and i + 1 etc.
I think need code like this:
Sub Picture_size_and_position()
Dim oShape As Shape
Dim oPresentation As Presentation
Dim oSlide As Slide
Dim oSelection As Selection
ActiveWindow.View.GotoSlide oSlide.SlideIndex
With ActiveWindow.Selection.ShapeRange
.LockAspectRatio = msoFalse
.Height = 550
.Width = 960
.Left = 0
.Top = 0
End With
End Sub
Then I'm sure I need a loop to repeat this until there's nothing left in the directory using some combination of i and j.