How to find and apply custom colorschemes by name in PowerPoint using VBA?

Robin Bouwmeester 46 Reputation points
2025-04-30T14:13:13.6633333+00:00

In PowerPoint users can add and apply custom color schemes on a slide.

Pick a colorscheme from theme

How can I programmatically set and apply a colorscheme by name 'Custom 2' using VBA?

https://learn.microsoft.com/en-us/office/vba/api/powerpoint.colorschemes

Microsoft 365 and Office | PowerPoint | For business | Windows
0 comments No comments
{count} votes

Accepted answer
  1. John Korchok 6,126 Reputation points Volunteer Moderator
    2025-04-30T20:36:24.1666667+00:00

    ColorSchemes is only there for backward compatibility. In Office 2007 and later, you would use ThemeColorScheme.Load. That command requires the complete path to the color theme, which will include your username. So you would need to use VBA to get that information:

    Sub SetColorTheme()
        strFilePath = Environ("APPDATA") & "\Microsoft\Templates\Document Themes\Theme Colors\"
        ActivePresentation.Designs(1).slideMaster.CustomLayouts(1).ThemeColorScheme.Load (strFilePath & "Custom 2.xml")
    End Sub
    

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.