Format related procedures in class Slide (PowerPoint VBA)

This page presents procedures from class Slide related to the theme Format: ApplyTheme, ApplyThemeColorScheme, BackgroundStyle, ColorScheme, CustomLayout, Layout, ThemeColorScheme, SlideRange.ApplyTheme, SlideRange.ApplyThemeColorScheme, SlideRange.BackgroundStyle, SlideRange.ColorScheme, SlideRange.CustomLayout, SlideRange.Layout and SlideRange.ThemeColorScheme

ApplyTheme

Applies a theme or design template to the specified slide.

Syntax : expression.ApplyTheme (themeName)

themeName: The path and name of the theme file (.thmx) or design template file (.pot) to apply to the Slide object.

ActivePresentation.Slides(1).ApplyTheme "C:\Program Files\Microsoft Office\Templates\MyTheme.thmx"

ApplyThemeColorScheme

Applies a color scheme to the specified slide.

Syntax : expression.ApplyThemeColorScheme (themeColorSchemeName)

themeColorSchemeName: The path and name of the color scheme file to apply to the slide.

Dim strthemeColorSchemeName As String: strthemeColorSchemeName = 
ActivePresentation.Slides.Range(1).ApplyThemeColorScheme themeColorSchemeName:=strthemeColorSchemeName

BackgroundStyle

Sets or returns the background style of the specified object.

The value of the BackgroundStyle property can be one of the MsoBackgroundStyleIndex constants.

ActivePresentation.Slides.Range(1).BackgroundStyle = msoBackgroundStyleMixed

ColorScheme

Returns or sets the ColorScheme object that represents the scheme colors for the specified slide, slide range, or slide master.

Set ActivePresentation.Slides.Range(1).ColorScheme = RGB(0,0,255)'blue

CustomLayout

Returns a CustomLayout object that represents the custom layout associated with the specified slide.

Set ActivePresentation.Slides.Range(1).CustomLayout =

Layout

Returns or sets a PpSlideLayout constant that represents the slide layout.

Possible Values are ppLayoutBlank - Blank, ppLayoutChart - Chart, ppLayoutChartAndText - Chart and text, ppLayoutClipartAndText - ClipArt and text, ppLayoutClipArtAndVerticalText - ClipArt and vertical text, ppLayoutComparison - Comparison, ppLayoutContentWithCaption - Content with caption, ppLayoutCustom - Custom, ppLayoutFourObjects - Four objects, ppLayoutLargeObject - Large object, ppLayoutMediaClipAndText - MediaClip and text, ppLayoutMixed - Mixed, ppLayoutObject - Object, ppLayoutObjectAndText - Object and text, ppLayoutObjectAndTwoObjects - Object and two objects, ppLayoutObjectOverText - Object over text, ppLayoutOrgchart - Organization chart, ppLayoutPictureWithCaption - Picture with caption, ppLayoutSectionHeader - Section header, ppLayoutTable - Table, ppLayoutText - Text, ppLayoutTextAndChart - Text and chart, ppLayoutTextAndClipart - Text and ClipArt, ppLayoutTextAndMediaClip - Text and MediaClip, ppLayoutTextAndObject - Text and object, ppLayoutTextAndTwoObjects - Text and two objects, ppLayoutTextOverObject - Text over object, ppLayoutTitle - Title, ppLayoutTitleOnly - Title only, ppLayoutTwoColumnText - Two-column text, ppLayoutTwoObjects - Two objects, ppLayoutTwoObjectsAndObject - Two objects and object, ppLayoutTwoObjectsAndText - Two objects and text, ppLayoutTwoObjectsOverText - Two objects over text, ppLayoutVerticalText - Vertical text, ppLayoutVerticalTitleAndText - Vertical title and text, ppLayoutVerticalTitleAndTextOverChart - Vertical title and text over chart.

The value of the Layout property can be one of these PpSlideLayout constants.

ActivePresentation.Slides.Range(1).Layout = ppLayoutBlank

ThemeColorScheme

Returns a ThemeColorScheme object that represents the color scheme associated with the specified slide.

Dim tcsThemeColorScheme As Office.ThemeColorScheme
Set tcsThemeColorScheme = ActivePresentation.Slides.Range(1).ThemeColorScheme

SlideRange.ApplyTheme

Applies a theme or design template to the specified range of slides.

Syntax : expression.ApplyTheme (themeName)

themeName: The path and name of the theme file (.thmx) or design template file (.pot) to apply to the SlideRange object.

Dim strthemeName As String: strthemeName = "C:\Program Files\Microsoft Office\Templates\MyTheme.thmx" 
ActivePresentation.Slides.Range.ApplyTheme themeName:=strthemeName

SlideRange.ApplyThemeColorScheme

Applies a color scheme to the specified range of slides.

Syntax : expression.ApplyThemeColorScheme (themeColorSchemeName)

themeColorSchemeName: The path and name of the color scheme file to apply to the range of slides.

Dim strthemeColorSchemeName As String: strthemeColorSchemeName = 
ActivePresentation.Slides.Range.ApplyThemeColorScheme themeColorSchemeName:=strthemeColorSchemeName

SlideRange.BackgroundStyle

Sets or returns the background style of the specified object.

The value of the BackgroundStyle property can be one of the MsoBackgroundStyleIndex constants.

ActivePresentation.Slides.Range.BackgroundStyle = msoBackgroundStyleMixed

SlideRange.ColorScheme

Returns or sets the ColorScheme object that represents the scheme colors for the specified slide, slide range, or slide master.

Set ActivePresentation.Slides.Range.ColorScheme = RGB(0,0,255)'blue

SlideRange.CustomLayout

Returns a CustomLayout object that represents the custom layout associated with the specified range of slides.

Set ActivePresentation.Slides.Range.CustomLayout =

SlideRange.Layout

Returns or sets a PpSlideLayout constant that represents the slide layout.

Possible Values are ppLayoutBlank - Blank, ppLayoutChart - Chart, ppLayoutChartAndText - Chart and text, ppLayoutClipartAndText - ClipArt and text, ppLayoutClipArtAndVerticalText - ClipArt and vertical text, ppLayoutComparison - Comparison, ppLayoutContentWithCaption - Content with caption, ppLayoutCustom - Custom, ppLayoutFourObjects - Four objects, ppLayoutLargeObject - Large object, ppLayoutMediaClipAndText - MediaClip and text, ppLayoutMixed - Mixed, ppLayoutObject - Object, ppLayoutObjectAndText - Object and text, ppLayoutObjectAndTwoObjects - Object and two objects, ppLayoutObjectOverText - Object over text, ppLayoutOrgchart - Organization chart, ppLayoutPictureWithCaption - Picture with caption, ppLayoutSectionHeader - Section header, ppLayoutTable - Table, ppLayoutText - Text, ppLayoutTextAndChart - Text and chart, ppLayoutTextAndClipart - Text and ClipArt, ppLayoutTextAndMediaClip - Text and MediaClip, ppLayoutTextAndObject - Text and object, ppLayoutTextAndTwoObjects - Text and two objects, ppLayoutTextOverObject - Text over object, ppLayoutTitle - Title, ppLayoutTitleOnly - Title only, ppLayoutTwoColumnText - Two-column text, ppLayoutTwoObjects - Two objects, ppLayoutTwoObjectsAndObject - Two objects and object, ppLayoutTwoObjectsAndText - Two objects and text, ppLayoutTwoObjectsOverText - Two objects over text, ppLayoutVerticalText - Vertical text, ppLayoutVerticalTitleAndText - Vertical title and text, ppLayoutVerticalTitleAndTextOverChart - Vertical title and text over chart.

The value of the Layout property can be one of these PpSlideLayout constants.

ActivePresentation.Slides.Range.Layout = ppLayoutBlank

SlideRange.ThemeColorScheme

Returns a ThemeColorScheme object that represents the color scheme associated with the specified range of slides.

Dim tcsThemeColorScheme As Office.ThemeColorScheme
Set tcsThemeColorScheme = ActivePresentation.Slides.Range.ThemeColorScheme