Consulting

Results 1 to 2 of 2

Thread: Question on importing 1 slide from all files within a directory

  1. #1

    Question on importing 1 slide from all files within a directory

    Hopefully I have been forgiven for my last bit of stupidity (bad path) and you will all take pity on me

    Anyway, this is a slightly different question from the last. I am importing a single slide (the first 1) from 27 different presentations. These are inputs from multiple individuals - who I know will not stick to a naming convention...so...instead of hard coding the file names, I would rather just import all the files (first slide of each) into my master. Then I can re-arrange the order of the slides to the order I want, which I think would be faster than changing all the filenames to be compliant.

    Here is my working code (a snippet)...
    ActivePresentation.Slides.InsertFromFile "c:\Weekly Import\file1.ppt", 1, 1, 1
    ActivePresentation.Slides.InsertFromFile "c:\Weekly Import\file2.ppt", ActivePresentation.Slides.Count, 1, 1
    ActivePresentation.Slides.InsertFromFile "c:\Weekly Import\file3.ppt", ActivePresentation.Slides.Count, 1, 1
    ActivePresentation.Slides.InsertFromFile "c:\Weekly Import\file4.ppt", ActivePresentation.Slides.Count, 1, 1
    Can anyone tell me how to do this? Grab all files from a directory?

    Thanks a ton.

    Kelly
    VBA Newbie
    Last edited by Aussiebear; 04-28-2023 at 02:11 AM. Reason: Added code tags

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    I could hardly improve on this so :
    http://pptfaq.com/FAQ00536.htm
    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
  •