Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
299 views
in Technique[技术] by (71.8m points)

Excel vba to add slide with layout - Title and content

With the below coding, I am able to add new slide in PowerPoint. Macro is running without any error. The only problem I am facing is related to layout. There are options in layout in PowerPoint and I want to use 'Title and Content' layout for newly added slide. Please assist.

Dim pres1 As PowerPoint.Presentation, pres2 As PowerPoint.Presentation, pp As Object

On Error Resume Next
Set pp = GetObject(, "PowerPoint.Application")
If Err.Number <> 0 Then Set pp = CreateObject("PowerPoint.Application")
On Error GoTo 0


Set pres2 = pp.Presentations.Open(Sheet1.TextBox2.Text)

Set NewSlide = pres2.Slides.Add(Index:=2, Layout:=ppLayoutCustom)
question from:https://stackoverflow.com/questions/65900868/excel-vba-to-add-slide-with-layout-title-and-content

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...