The following VBA example exports a document to GIF format and sets white to transparent.
Sub Test()
Dim exp As ExportFilter
Dim pal As StructPaletteOptions
Dim se As StructExportOptions
Dim n As Long
Dim i As Integer
Set pal = CreateStructPaletteOptions
Set se = CreateStructExportOptions
With pal
.DitherType = cdrDitherNone
.Smoothing = 5
.PaletteType = cdrPaletteOptimized
End With
With se
.AntiAliasingType = cdrNormalAntiAliasing
.Dithered = False
.ResolutionX = 96
.ResolutionY = 96
End With
Set exp = ActiveDocument.ExportEx("c:\transparent.gif", cdrGIF, , se, pal)
With exp
n = .NumColors
For i = 1 To n
If .PaletteColor(i) = RGB(255, 255, 255) Then
.ColorIndex = i
.Transparency = 1
Exit For
End If
Next i
.Finish
End With
End Sub