Results 1 to 19 of 19

Thread: Simple Macro to import slides from a file

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,096
    Location
    This should get you going:
    Modify the path to point to your folder (don't forget the final \)

    Sub Combine_fromFolder()
        Dim strFPath As String
        Dim strSpec As String
        Dim strFileName As String
        Dim oTarget As Presentation
        Set oTarget = Application.Presentations.Add(WithWindow:=True)
        strFPath = "C:\Users\John\Desktop\Test\"        ' Edit this
        strSpec = "*.PPTX" 'to include PPT etc use "*.PP*"
        strFileName = Dir$(strFPath & strSpec)
        While strFileName <> ""
       oTarget.Slides.InsertFromFile strFileName, oTarget.Slides.Count, 1, 1
       strFileName = Dir()
        Wend
    End Sub
    Last edited by Aussiebear; 04-08-2023 at 03:54 PM. Reason: Adjusted the code tags
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •