M
Mengoxon
Hi,
this has been a topic of discussion many times before (but
unfortunately on Google Groups you cannot reply later than a month -
why doesn't Google start a real tech support forum?).
How do I insert a folder full of pictures into a PowerPoint
presentation, where each picture gets its own slide?
Searching the Internet, I found the following Visual Basic script:
Sub ImportABunch()
Dim strTemp as String
Dim strFileSpec as String
Dim oSld as Slide
Dim oPic as Shape
strFileSpec = "Give it a complete mac or PC style file path here"
' Ex. on a PC: "C:\My Pictures\Flowers\*.PNG"
strTemp = Dir(strFileSpec)
Do While strTemp <> ""
Set oSld = ActivePresentation.Slides.Add(ActivePresentation.Slides.Count
+ 1, ppLayoutBlank)
Set oPic = ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:=strFileSpec,
_
LinkToFile:=msoFalse, _
SaveWithDocument:=msoTrue, _
Left:=0, _
Top:=0, _
Width:=100, _
Height:=100)
' Reset it to its "real" size
With oPic
.ScaleHeight 1, msoTrue
.ScaleWidth 1, msoTrue
End With
' and optionally, make it fill the slide - to do that, uncomment the
following:
' With oPic
' .Height = ActivePresentation.PageSetup.SlideHeight
' .Width = ActivePresentation.PageSetup. SlideWidth
' End n
' Get the next file that meets the spec and go round again
strTemp = Dir
Loop
End Sub
Search terms:
Batch Insert a folder full of pictures, one per slide
http://www.rdpslides.com/pptfaq/FAQ00352.htm
But modifying this for a Mac, I could not make it run. A file path
such as:
' Ex. on a PC: "C:\My Pictures\Flowers\*.PNG"
would read as follows in Mac-ese:
"Macintosh HD:Users:johnesktop:Images:"
Visual Basic on Mac does not support the wild card with asterisk (*),
presumably because Mac OS 9 did not support it. So I have to use the
MacID function (see Powerpoint Help for instruction). I presume that
the MacID for a JPEG file is MacID("JPEG") but I do not know for sure.
So I tried these combinations but it did not seem to work - nothing
happens. If I specify a specific file, it inserts that one picture, so
that part of the script is fine.
Does anybody know how to make this work?
this has been a topic of discussion many times before (but
unfortunately on Google Groups you cannot reply later than a month -
why doesn't Google start a real tech support forum?).
How do I insert a folder full of pictures into a PowerPoint
presentation, where each picture gets its own slide?
Searching the Internet, I found the following Visual Basic script:
Sub ImportABunch()
Dim strTemp as String
Dim strFileSpec as String
Dim oSld as Slide
Dim oPic as Shape
strFileSpec = "Give it a complete mac or PC style file path here"
' Ex. on a PC: "C:\My Pictures\Flowers\*.PNG"
strTemp = Dir(strFileSpec)
Do While strTemp <> ""
Set oSld = ActivePresentation.Slides.Add(ActivePresentation.Slides.Count
+ 1, ppLayoutBlank)
Set oPic = ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:=strFileSpec,
_
LinkToFile:=msoFalse, _
SaveWithDocument:=msoTrue, _
Left:=0, _
Top:=0, _
Width:=100, _
Height:=100)
' Reset it to its "real" size
With oPic
.ScaleHeight 1, msoTrue
.ScaleWidth 1, msoTrue
End With
' and optionally, make it fill the slide - to do that, uncomment the
following:
' With oPic
' .Height = ActivePresentation.PageSetup.SlideHeight
' .Width = ActivePresentation.PageSetup. SlideWidth
' End n
' Get the next file that meets the spec and go round again
strTemp = Dir
Loop
End Sub
Search terms:
Batch Insert a folder full of pictures, one per slide
http://www.rdpslides.com/pptfaq/FAQ00352.htm
But modifying this for a Mac, I could not make it run. A file path
such as:
' Ex. on a PC: "C:\My Pictures\Flowers\*.PNG"
would read as follows in Mac-ese:
"Macintosh HD:Users:johnesktop:Images:"
Visual Basic on Mac does not support the wild card with asterisk (*),
presumably because Mac OS 9 did not support it. So I have to use the
MacID function (see Powerpoint Help for instruction). I presume that
the MacID for a JPEG file is MacID("JPEG") but I do not know for sure.
So I tried these combinations but it did not seem to work - nothing
happens. If I specify a specific file, it inserts that one picture, so
that part of the script is fine.
Does anybody know how to make this work?