将 Section/Chapter 标签添加到幻灯片 header
Adding Section/Chapter label to slide header
我想知道 Powerpoint 是否有一项功能,我可以自动将格式化的 header 添加到显示第 and/or 章节的每张幻灯片。我正在展示我的论文,它分为几个部分,例如“方法”或“评估”,如果我可以在每张幻灯片的 header 中自动显示它,我会很高兴。最好是从我的 powerpoint 部分自动获取。
我想要这种外观,我目前正在为每张幻灯片手动制作。
PowerPoint 没有这样的功能built-in。
但是,与大多数 Office 产品一样,PowerPoint 确实有一个非常强大的 VBA 宏引擎,它肯定能够做到这一点。
您的宏必须根据您选择用于标记的任何参数来捕获节名称,然后它可以将该信息放置在后续幻灯片中您喜欢的任何位置。
因为幻灯片更多的是关于视觉布局而不是编程auto-creation,这是你必须自己构建的东西。
这里有一些起始代码,可让您获得每张幻灯片所属部分的名称。
请您提供代码以将文本添加到每张幻灯片并 position/format 它。
Sub Test()
Dim oSl As Slide
' Make sure there ARE sections
If ActivePresentation.SectionProperties.Count > 0 Then
For Each oSl In ActivePresentation.Slides
Debug.Print GetSection(oSl)
Next
End If
End Sub
Function GetSection(oSl As Slide) As String
' Returns the name of the section that this slide belongs to.
With oSl
Debug.Print .sectionIndex
GetSection = ActivePresentation.SectionProperties.Name(.sectionIndex)
End With
我想知道 Powerpoint 是否有一项功能,我可以自动将格式化的 header 添加到显示第 and/or 章节的每张幻灯片。我正在展示我的论文,它分为几个部分,例如“方法”或“评估”,如果我可以在每张幻灯片的 header 中自动显示它,我会很高兴。最好是从我的 powerpoint 部分自动获取。
我想要这种外观,我目前正在为每张幻灯片手动制作。
PowerPoint 没有这样的功能built-in。
但是,与大多数 Office 产品一样,PowerPoint 确实有一个非常强大的 VBA 宏引擎,它肯定能够做到这一点。
您的宏必须根据您选择用于标记的任何参数来捕获节名称,然后它可以将该信息放置在后续幻灯片中您喜欢的任何位置。
因为幻灯片更多的是关于视觉布局而不是编程auto-creation,这是你必须自己构建的东西。
这里有一些起始代码,可让您获得每张幻灯片所属部分的名称。 请您提供代码以将文本添加到每张幻灯片并 position/format 它。
Sub Test()
Dim oSl As Slide
' Make sure there ARE sections
If ActivePresentation.SectionProperties.Count > 0 Then
For Each oSl In ActivePresentation.Slides
Debug.Print GetSection(oSl)
Next
End If
End Sub
Function GetSection(oSl As Slide) As String
' Returns the name of the section that this slide belongs to.
With oSl
Debug.Print .sectionIndex
GetSection = ActivePresentation.SectionProperties.Name(.sectionIndex)
End With