Results 1 to 4 of 4

Thread: Insert PowerPoint slides keeping source formatting

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Oct 2013
    Posts
    17
    Location

    Insert PowerPoint slides keeping source formatting

    Hi,
    I have an Access database with VBA that produces a PowerPoint presentation based on the chosen fields of the database. One feature of this database I would like to do is to be able to insert other PowerPoint presentations into the new presentation. I have been able to do this so far with:
              .Slides.InsertFromFile _
              FileName:=(rs.Fields("Extra slides 1")), Index:=0
    but this does not keep the source formatting of the slides. Looking around I found that I could copy and paste the slides in instead using code like this:
    Dim objPresentation As Presentation
    Dim intobj As Integer
    
    
    Set objPresentation = Presentations.Open("C:\123.pptx", , msoFalse) 'Error on this line
    
    For intobj = 1 To objPresentation.Slides.Count
        objPresentation.Slides.Item(intobj).Copy
        Presentations.Item(1).Slides.Paste
        Presentations.Item(1).Slides.Item(Presentations.Item(1).Slides.Count).Design = _
            objPresentation.Slides.Item(intobj).Design
    Next intobj
    objPresentation.Close
    But this is not working - I am getting error code '2147221164 Class not registered' on the line indicated and the slides are not copying in. My guess is that as the code is all running in Access to generate the presentation it doesn't know where to paste the new slides?? Any ideas?
    Thanks!
    Last edited by fkneg1; 07-20-2023 at 12:06 AM.

Tags for this Thread

Posting Permissions

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