Consulting

Results 1 to 2 of 2

Thread: Replicate template presentation with list of names in excel

  1. #1
    VBAX Newbie
    Joined
    Apr 2018
    Posts
    1
    Location

    Replicate template presentation with list of names in excel

    Hi All,

    Relatively new to VBA in ppt 2013, have previously only used in excel. I have a template presentation that I need to replicate 100 times for different individuals, with only slight changes to each presentation. If I have a standardized list of names in excel (e.g. FirstName + LastName concatenated into one column), is there a way to:

    1. Create a new copy of the template ppt presentation for each individual and save to the same folder/path (e.g. "PresentationTitle_LASTNAME_FIRSTNAME.pptx); and
    2. Insert that individual's name on the title slide as well (title page template attached)?

    The desired end result would be 100 presentations saved to the same destination with each individuals' name in both the file name and on the title page.

    Many thanks in advance for any guidance with this.

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    Do it in Excel VBA then (Create a ref to PowerPoint)

    Loop through the names and use them like this

    Sub makePres()
    Dim pptpres As PowerPoint.Presentation
    Dim pptapp As PowerPoint.Application
    Dim firstName As String
    Dim lastName As String
    Set pptapp = CreateObject(Class:="PowerPoint.Application")
    Set pptpres = pptapp.Presentations.Open("C:\Users\johns\Desktop\Presentation A.pptx")
    'FOR LOOP to get names
    'just example
    firstName = "John"
    lastName = "Wilson"
    
    
    pptpres.Slides(1).Shapes.Title.TextFrame.TextRange = lastName & "  " & firstName
    Debug.Print pptpres.Path & "\" & firstName & "_" & lastName & ".pptx"
    pptpres.SaveCopyAs pptpres.Path & "\" & firstName & "_" & lastName & ".pptx"
    'NEXT
    
    
    
    
    End Sub
    Note this is just a pointer not intended to be robust debugged code!
    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
  •