V
Vincent Verheul
Hello,
In PowerPoint 2003 I successfully use Visual Basic code to save a Powerpoint
Slide into GIF format with a transparent background. This does not seem to
work anymore in PowerPoint 2007. I have selected the option "Save as
PowerPoint 97-2003".
This is the code:
Sub TestTransparency(PPT As PowerPoint.Application, Pres As
PowerPoint.Presentation)
Const FileName = "TestTransparency.ppt"
' skipped some code to set the PPT and Pres objects
PPT.Visible = True
With Pres.Slides(1)
.FollowMasterBackground = False
.Background.Fill.BackColor.RGB = RGB(255, 255, 255)
.Background.Fill.Transparency = 1
End With
Call Pres.SaveAs(FileName, ppSaveAsGIF)
' PowerPoint saves the GIF in a separate folder with the name of the
selected slide
End Sub
In fact I am running this out of an MsAccess application using the
PowerPoint library, but that should not make a difference.
Also when doing this manually via the PowerPoint user interface the saved
GIF file has no transparent background: In a slide use the right mouse
button and select Format Background ... then select Solid Fill, Hide
Background Graphics, (optionally select a color, I use white: RGB
255,255,255) and set Transparency to 100%. Then Save As... Other Formats...
GIF.
In PowerPoint 2003 I successfully use Visual Basic code to save a Powerpoint
Slide into GIF format with a transparent background. This does not seem to
work anymore in PowerPoint 2007. I have selected the option "Save as
PowerPoint 97-2003".
This is the code:
Sub TestTransparency(PPT As PowerPoint.Application, Pres As
PowerPoint.Presentation)
Const FileName = "TestTransparency.ppt"
' skipped some code to set the PPT and Pres objects
PPT.Visible = True
With Pres.Slides(1)
.FollowMasterBackground = False
.Background.Fill.BackColor.RGB = RGB(255, 255, 255)
.Background.Fill.Transparency = 1
End With
Call Pres.SaveAs(FileName, ppSaveAsGIF)
' PowerPoint saves the GIF in a separate folder with the name of the
selected slide
End Sub
In fact I am running this out of an MsAccess application using the
PowerPoint library, but that should not make a difference.
Also when doing this manually via the PowerPoint user interface the saved
GIF file has no transparent background: In a slide use the right mouse
button and select Format Background ... then select Solid Fill, Hide
Background Graphics, (optionally select a color, I use white: RGB
255,255,255) and set Transparency to 100%. Then Save As... Other Formats...
GIF.