Hi,
I've am trying to create a template that will allow the batch import of images from a single folder. The folder however will be different each time and so hard coding the directory is too static.
I have been using the BATCH insert code and have it working perfectly. I can not however work out how to have the directory in which the images sit as a user definable path.
[vba]Sub ImportImagesforPhotoPack()
Dim strTemp As String
Dim strPath As String
Dim strFileSpec As String
Dim oSld As Slide
Dim oPic As Shape
' Edit these to suit:
strPath = "C:\Documents and Settings\richardg\My Documents\AutoPPT\Images\"
strFileSpec = "*.jpg"
strTemp = Dir(strPath & strFileSpec)
Do While strTemp <> ""
Set oSld = ActivePresentation.Slides.Add(ActivePresentation.Slides.Count + 1, ppLayoutBlank)
Set oPic = oSld.Shapes.AddPicture(FileName:=strPath & strTemp, _
LinkToFile:=msoFalse, _
SaveWithDocument:=msoTrue, _
Left:=60, _
Top:=32, _
Width:=1037, _
Height:=742)
' Get the next file that meets the spec and go round again
strTemp = Dir
Loop
End Sub[/vba]
I hope this has'nt been asked too many times, thank you for you help.
Richard.