Attached is an image of the export options I want to execute with my macro. This is my function and it's ingnoring the palette options. Anyone who can I help me? Image has to be png, transparent,t 8 bit.
Public Sub Export8Bit(ByVal filepath As String, ByVal filename As String, ByVal selectionRange As ShapeRange, ByVal scaleFactor As Double) Dim opt As New StructExportOptions Dim x As Double Dim y As Double Dim pal As New StructPaletteOptions ActiveDocument.Unit = cdrPixel opt.AntiAliasingType = cdrNormalAntiAliasing opt.ImageType = cdrRGBColorImage opt.Overwrite = True opt.ResolutionX = 96 opt.ResolutionY = 96 opt.Transparent = True opt.UseColorProfile = False opt.MaintainAspect = True pal.DitherType = cdrDitherFloyd pal.NumColors = 128 pal.PaletteType = cdrPaletteOptimized pal.DitherIntensity = 100 Set selectionRange = DeleteGuidelines(selectionRange) selectionRange.CreateSelection selectionRange.GetSize x, y opt.SizeX = x * scaleFactor opt.SizeY = y * scaleFactor ActiveDocument.Export filepath & filename & ".png", cdrPNG, cdrSelection, opt, palEnd Sub
Sorry, forgot to mention the fix, opt.ImageType should be cdrPalettedImage not cdrRGBColorImage.