The following VBA example creates a few shapes and exports the document to the JPEG format.
Sub Test()
Dim exp As ExportFilter
Dim se As StructExportOptions
ActiveLayer.CreateRectangle 1, 2, 3, 4
ActiveLayer.CreateRectangle2 4, 4, 5, 5
ActiveLayer.CreatePolygon 1, 3, 4, 5, 6
Set se = CreateStructExportOptions
With se
.AntiAliasingType = cdrNormalAntiAliasing
.ImageType = cdrRGBColorImage
.ResolutionX = 97
.ResolutionY = 97
End With
Set exp = ActiveDocument.ExportEx("c:\primitives.jpg", cdrJPEG, cdrCurrentPage, se)
exp.Finish
End Sub