Private Sub CopySlideFormats(ByRef SourceSlide As PowerPoint.Slide, ByRef TargetSlide As PowerPoint.Slide)
With TargetSlide
Let .Design = SourceSlide.Design
Let .ColorScheme = SourceSlide.ColorScheme
If SourceSlide.FollowMasterBackground = False Then
Let .FollowMasterBackground = False
With .Background.Fill
Let .Visible = SourceSlide.Background.Fill.Visible
Let .ForeColor = SourceSlide.Background.Fill.ForeColor
Let .BackColor = SourceSlide.Background.Fill.BackColor
End With
Select Case SourceSlide.Background.Fill.Type
Case Is = msoFillTextured
Select Case SourceSlide.Background.Fill.TextureType
Case Is = msoTexturePreset
Call .Background.Fill.PresetTextured(SourceSlide.Background.Fill.PresetTexture)
Case Is = msoTextureUserDefined
End Select
Case Is = msoFillSolid
Let .Background.Fill.Transparency = 0#
Call .Background.Fill.Solid
Case Is = msoFillPicture
With SourceSlide
If .Shapes.Count > 0 Then .Shapes.Range.Visible = msoFalse
Dim bMasterShapes As MsoTriState
bMasterShapes = .DisplayMasterShapes
.DisplayMasterShapes = msoFalse
.Export SourceSlide.Parent.Path & .SlideID & ".png", "PNG"
End With
Call .Background.Fill.UserPicture(SourceSlide.Parent.Path & SourceSlide.SlideID & ".png")
Call Kill(SourceSlide.Parent & SourceSlide.SlideID & ".png")
With SourceSlide
Let .DisplayMasterShapes = bMasterShapes
If .Shapes.Count > 0 Then .Shapes.Range.Visible = msoTrue
End With
Case Is = msoFillPatterned
Call .Background.Fill.Patterned(SourceSlide.Background.Fill.Pattern)
Case Is = msoFillGradient
Select Case SourceSlide.Background.Fill.GradientColorType
Case Is = msoGradientTwoColors
Call .Background.Fill.TwoColorGradient( _
SourceSlide.Background.Fill.GradientStyle, _
SourceSlide.Background.Fill.GradientVariant)
Case Is = msoGradientPresetColors
Call .Background.Fill.PresetGradient( _
SourceSlide.Background.Fill.GradientStyle, _
SourceSlide.Background.Fill.GradientVariant, _
SourceSlide.Background.Fill.PresetGradientType)
Case Is = msoGradientOneColor
Call .Background.Fill.OneColorGradient( _
SourceSlide.Background.Fill.GradientStyle, _
SourceSlide.Background.Fill.GradientVariant, _
SourceSlide.Background.Fill.GradientDegree)
End Select
Case Is = msoFillBackground
' Only applicable to shapes.
End Select
End If
End With
End Sub