更新所有幻灯片母版和版式页脚 [英] Update all slide master's and layout's footers
本文介绍了更新所有幻灯片母版和版式页脚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Sub footchange()
Dim myValue As Variant
Dim sld As Slide
myValue = InputBox("Enter Presentation Name")
Set mySlidesHF = ActivePresentation.SlideMaster.HeadersFooters
'Add name to slide master footer
With mySlidesHF
.Footer.Visible = True
.Footer.Text = myValue + " | Confidential © 2020"
.SlideNumber.Visible = True
End With
'Add name to slide master layouts footers
For Each sld In ActivePresentation.Slides
With sld.HeadersFooters
.Footer.Visible = True
.Footer.Text = myValue + " | Confidential © 2020"
.SlideNumber.Visible = True
End With
Next
推荐答案
我能够通过为每个母版幻灯片中的版面添加第二个嵌套循环来更新所有母版幻灯片/版面:
Sub footchange()
Dim myValue As Variant
Dim sld As Slide
'Add design and layout variables
Dim oMaster As Design
Dim cLay As CustomLayout
myValue = InputBox("Enter Presentation Name")
'Just to show you how many Masters you have
Debug.Print ActivePresentation.Designs.Count
'Loop through them
For Each oMaster In ActivePresentation.Designs
'Use actual Design
Set mySlidesHF = oMaster.SlideMaster
Set myLayoutsHF = oMaster.SlideMaster.CustomLayouts
'Add name to slide master footer
With mySlidesHF.HeadersFooters
.Footer.Visible = True
.Footer.Text = myValue + " | Confidential © 2020"
.SlideNumber.Visible = True
End With
'Add name to layouts
For Each cLay In myLayoutsHF
With cLay.HeadersFooters
.Footer.Visible = True
.Footer.Text = myValue + " | Confidential © 2020"
.SlideNumber.Visible = True
End With
Next cLay
Next oMaster
End Sub
这篇关于更新所有幻灯片母版和版式页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文