"" Set oSld = ActivePresentation.Slides.Add(ActivePresentation.Slides.Count + 1, ppLayoutBlank) … more code is here ' Get the next file that meets the spec and go round again strTemp = Dir Loop End Sub"> "" Set oSld = ActivePresentation.Slides.Add(ActivePresentation.Slides.Count + 1, ppLayoutBlank) … more code is here ' Get the next file that meets the spec and go round again strTemp = Dir Loop End Sub">
Download presentation
Presentation is loading. Please wait.
1
Images into PowerPoint
This is a ‘blank’ PowerPoint presentation that contains a macro, ‘ImportBunchOfImages’ that will read a folder of images and create a single slide for each image. When you opened this presentation, if you didn’t enable macros, close and reopen with macros enabled. Image format can be any that are compatible with PowerPoint (e.g. JPG, TIF, PNG). The macro will need to be edited to modify folder location on your computer and the image extension being used (i.e. currently set to “*.jpg”). First, save this PowerPoint example as a new presentation with a name of your choice. File/Save as Enter new presentation name
2
Image Macro Code When you follow the editing instructions on the next slide, this is a portion of the code that you will see and edit in the Visual Basic Editor. Note: Editing the code on this slide will not alter the macro as required for use. Sub ImportBunchOfImages() 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 = "strPath = "c:\Dudley\Downloads\PowerPoint\“ strFileSpec = "*.jpg" strTemp = Dir(strPath & strFileSpec) Do While strTemp <> "" Set oSld = ActivePresentation.Slides.Add(ActivePresentation.Slides.Count + 1, ppLayoutBlank) … more code is here ' Get the next file that meets the spec and go round again strTemp = Dir Loop End Sub
3
Editing the Import Macro
To edit… Tools/Macro/Visual Basic Editor (or Alt F11) DoubleClick on ‘Module1’ It may be necessary to expand the project tree in the left panel of the editor to locate ‘Module1’ Make changes in directory and file extension Save Close Module window and VB Editor
4
To Use (Run) the Macro To use the macro… Tools/Macro/Macros
Click on the ‘Run’ button with ImportBunchOfImages highlighted A new slide should be created for each image found in the folder you pointed to in the macro code.
5
Completing Your PowerPoint
To complete your new PowerPoint presentation… Delete the first six slides (these instructions) Add a presentation name & title slide (if desired) Add other text as needed on each image slide. Save
6
Credits This VBA code was provided by…
Power Tools for PowerPoint Users Prepared by… Dudley R. Hartel, Center Coordinator Southern Center for Urban Forestry Research & Information (706)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.