Theme オブジェクト (PowerPoint)

テーマ (色、フォント、効果のコレクション) を表します。

次のコード例では、現在アクティブなテーマへの参照を取得し、テーマ内の各テーマバリエーションを反復処理します。

Sub IterateThemeVariants()

    Dim pptTheme As Theme
    Dim pptThemeVariants As ThemeVariants
    Dim pptThemeVariant As ThemeVariant
    Dim path As String
    
    ' Get a reference to the currently active theme.
    path = "C:\Program Files (x86)\Microsoft Office\Document Themes 15\" & _
        ActivePresentation.TemplateName & ".thmx"
    Set pptTheme = Application.OpenThemeFile(path)
    
    ' Get a reference to all of the variations in the theme.
    Set pptThemeVariants = pptTheme.ThemeVariants
    
    ' Iterate over each variation of the theme and print
    ' its ID.
    For Each pptThemeVariant In pptThemeVariants
    
        Debug.Print "Variation id: " & pptThemeVariant.Id
    
    Next pptThemeVariant

End Sub

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。