Created
November 1, 2017 22:00
-
-
Save marceloszilagyi/d4f77a551549140b8062126c5a7eddff to your computer and use it in GitHub Desktop.
Add image from folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Insert_Pics() | |
Dim strTemp As String | |
Dim strPath As String | |
Dim strFileSpec As String | |
Dim oSld As Slide | |
Dim oPic As Shape | |
' logos will be inserted in the alpha sequence; I renamed files with leading numbers (001, 002) | |
strPath = "C:\Users\logos\" | |
strFileSpec = "*.*" | |
strTemp = Dir(strPath & strFileSpec) | |
ActiveWindow.View.GotoSlide (1) | |
Do While strTemp <> "" | |
Set oSld = ActivePresentation.Slides(1 + j) | |
Set oPic = oSld.Shapes.AddPicture(FileName:=strPath & strTemp, _ | |
LinkToFile:=msoFalse, _ | |
SaveWithDocument:=msoTrue, _ | |
Left:=520, _ | |
Top:=82, _ | |
Width:=-1, _ | |
Height:=-1) | |
oPic.LockAspectRatio = msoTrue | |
oPic.Height = 25 | |
strTemp = Dir | |
j = j + 1 | |
Loop | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment