# Posts by AHernandez

• ## VBA: Transfer A Custom PowerPoint Layout Using InsertFromFile() method ?

Question: I am using the Slides.InsertFromFile method in VBA in order to insert slides from a PowerPoint presentation called FinalPPTX onto a PowerPoint Presentation called Omnibus beginning at a specified slide number:

Code
FileInsert = OmnibusPresentation.Slides.InsertFromFile(temp & FinalPPTX, slideNumber)

The code works. However the custom layout on the slides from FinalPPTX are not carried over into the Omnibus presentation. How might I correct this ?

• ## How To Insert One PowerPoint Presentation Into Another PowerPoint Presentation at A Specified Slide Number.

I figured it out myself:

Code
Dim FileInsert As Long
FileInsert = OmnibusPresentation.Slides.InsertFromFile(temp & FinalPPTX, slideNumber)
OmnibusPresentation.Slides(slideNumber).Delete
• ## How To Insert One PowerPoint Presentation Into Another PowerPoint Presentation at A Specified Slide Number.

Hello everyone. This is my first time asking a question. I have a VBA problem that I am trying to solve. I am certain I have approached the problem correctly and am close to solving it.

Brief Description:

I want to insert a presentation FinalPPTXPresentation onto OmnibusPresentation after a specifying a slide number on OmnibusPresentation.

Long Description:

The goals is to have a VBA script that would loop through a folder called Test; which contains Omnibus.pptx, and find amongst its subfolders the path Test\ 0X.stringX \ Y.stringY \ Final \ Final.pptx and extract the value 0X.Y and then search Omnibus.pptx and locate the slide containing the text "Placeholder for slides from 0X.Y.". Once found it would remove that slide and insert the presentation Final.pptx.

I have everything I need but the final punch; which is inserting one powerpoint presentation into another at a specific slide number. Note: My VBA code is contained on a module in Excel and not a pptx file. Whence the Excel tag.

The "main" module:

Code
'VBA Script to Generate PPT presentation
Public Sub BuildOmnibusPointPresentation()
Call RecursivelySearchFolder("\\company.com\abc\def\ghi\jkl\mno\pqr\Test set up")
End Sub

Recursively search folders and subfolders:

Extract placeholder index from folder structure. This is subtle. But what this nifty script does extract characters from a given string and concatenates them:

This is where my programming skills get muddle and I become confused - but it works.