Problem changing slide background color


I’m opening an existing powerpoint presentation and retrieving a slide. I set the background color as in this code snippet:

slide = pres.GetSlideByPosition(6)
slide.FollowMasterBackground = False
slide.Background.FillFormat.Type = FillType.Solid
slide.Background.FillFormat.BackColor = System.Drawing.Color.Gray

img = slide.GetThumbnail(1, 1)

’ Tried img.Save, and here tried converting to a bitmap instead…
Dim bmap As New Bitmap(img, 300, 400)
bmap.Save(“testout.jpg”)

but when I output a thumbnail the background remains unchanged.
Can you identify what I am doing wrong?

slide.Background.FillFormat.ForeColor = System.Drawing.Color.Gray

The main color for background is ForeColor.
BackColor used for gradients and patterns only.

Yes, thank you, that works.Smile