How to insert more than 4 Images on one slide on Powerpoint 2016?

Hi Guys,

I am a fashion buyer and I am required to submit my order photos on powerpoint. I know there is an Insert Album Function that inserts a max of 4 images. I want at least 6 images per slide. Is there a VB Script available for that?

Thank you so much!

- Wael
Wael TimbaliyahAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Echo_SCommented:
You might check into Shyam Pillai's Image Importer Wizard. http://www.skphub.com/iiw.htm
0
Wael TimbaliyahAuthor Commented:
Hi Echo_S,

Tried that but the version is incompatible with 2016 PowerPoint.

I will definitely need a VB script for that.

Thanks for you suggestion though :)

Wael
0
Echo_SCommented:
Oh, I didn't realize that. Let me ask Shyam if there's an update.
0
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

Wael TimbaliyahAuthor Commented:
Thanks Echo_S, life saver!
0
Echo_SCommented:
Okay, looks like it is indeed compatible with PPT 2016 (32-bit only). It will appear on the Add-ins tab of the Ribbon. I confirmed that it appears there for me in PPT 2016.

Shyam also said he's just getting around to updating it for 64-bit PPT, so if you need that it should be available relatively soon.
0
Jamie GarrochSenior Technical Consultant at BrightCarbonCommented:
I got interrupted whilst writing the VBA script below so sorry for the delayed response. If you still want a script rather than the much more highly featured add-in that Echo recommended, this macro will do what you need for 6 images (or more if you adapt it). Some caveats:

1. You need to create a custom layout in the slide master and name it "Photos". Then add 6 picture placeholders to this new layout.
2. You must not have more than one slide master in the presentation.
3. You set the folder to look for pictures by changing this line:
Const myFolder = "C:\MyPictures"

Open in new window

4. The folder should not have sub folders or any files in it that are not valid image files e.g. JPG, PNG, TIFF etc.
5. To run it, copy the code to a code module in the VBE (Alt+F11 then Insert/Module). Make sure you have a writeable presentation open and the slide selected where you want the news slides to be added after. Then press Alt+F8 and run the InsertPicturesFromFolder macro.
6. I wrote it very quickly so there is no error handling and it will throw errors at you if you do something different to the above!

Here's the full code:

Option Explicit

#Const DevMode = False ' To use IntelliSense, change to True and add a reference to Microsoft Scripting Runtime

Sub InsertPicturesFromFolder()
#If DevMode Then
  Dim oFSO As FileSystemObject
  Dim oFldr As Folder
  Dim oFile As File
#Else
  Dim oFSO As Object
  Dim oFldr As Object
  Dim oFile As Object
#End If
  Dim x As Long
  Dim lFiles As Long
  Dim lFile As Long
  Dim lSlides As Long
  Dim lSlide As Long
  Dim oColSld As New Collection
  Dim oColPH As New Collection
  Dim oColFiles As New Collection
  Dim oSld As Slide
  Dim oPH As Shape
  
  Const myFolder = "C:\MyPictures"
  Const PicsPerSlide = 6
  
  Set oFSO = CreateObject("Scripting.FileSystemObject")
  
  Set oFldr = oFSO.GetFolder(myFolder)
  For Each oFile In oFldr.Files
    oColFiles.Add oFile.Path
  Next
  
  lFiles = oFldr.Files.Count
  lSlides = lFiles / PicsPerSlide + IIf(lFiles / PicsPerSlide > Int(lFiles / PicsPerSlide), 1, 0)
  
  With ActivePresentation
    For x = 1 To lSlides
      oColSld.Add .Slides.AddSlide(ActiveWindow.View.Slide.SlideIndex + x, .Designs(1).SlideMaster.CustomLayouts(GetLayout("Photos").Index))
    Next
  End With
  
  For Each oSld In oColSld
    With oSld
      For Each oPH In .Shapes.Placeholders
        If oPH.Type = msoPlaceholder Then
          If oPH.PlaceholderFormat.Type = ppPlaceholderPicture Then oColPH.Add oPH
        End If
      Next
      For Each oPH In oColPH
        lFile = lFile + 1
        If lFile <= lFiles Then oSld.Shapes.AddPicture oColFiles(lFile), msoFalse, msoTrue, oPH.Left, oPH.Top, oPH.Width, oPH.Height
      Next
      Do While oColPH.Count > 0
        oColPH.Remove (oColPH.Count)
      Loop
    End With
  Next
  
  ' Clean up
  Set oFSO = Nothing
  Set oFldr = Nothing
  Set oFile = Nothing
End Sub

Function GetLayout(LayoutName As String) As CustomLayout
  Dim oCL As CustomLayout
  For Each oCL In ActivePresentation.Designs(1).SlideMaster.CustomLayouts
    If oCL.Name = LayoutName Then Set GetLayout = oCL: Exit Function
  Next
End Function

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Wael TimbaliyahAuthor Commented:
That worked perfectly! Thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.