This question has been sitting in my mind for a long time.. when I export a document to bitmap with GUI there's an overprint black option in the export window. However I couldn't find this option in the parameters of exportBitmap. Am I missing something or did the devs simply missed covering this in VBA? If so is there any workaround for exporting jpegs with black overprint in VBA? Thanks for reading.
Have you tried "recording" a macro while doing it manually, and then looking at the VBA code that is generated?
Some things cannot be recorded in that way, so it doesn't always provide an answer - but it can be useful in some cases.
Yes I have, unfortunately it doesn't record the export dialog. The recorded code is essentially blank.
After delving the documentation with no success, I asked ChatGPT in my desperate hope of finding a clue. Funnily enough, it told me to use Export instead of ExportBitmap. But I clearly remember that I did not see the overprint black property in the Export method. But there it is, AlwaysOverprintBlack in StructExportOptions. I guess I was looking for Properties starting with Overprint or Black, and did not expect the word Always.
Sub ExportAllPagesToImage(DPI As Integer, ImageType As cdrImageType) Dim ActiveDocumentName As String Dim Opt As New StructExportOptions For i = 1 To ActiveDocument.Pages.Count ActiveDocument.Pages(i).Activate ActiveDocumentName = Replace(ActiveDocument.Name, ".cdr", "") Opt.AlwaysOverprintBlack = True Opt.ImageType = ImageType 'Opt.UseColorProfile = True Opt.ResolutionX = DPI Opt.ResolutionY = DPI Dim Filter As ExportFilter Set Filter = ActiveDocument.ExportEx(DESIGN_BASE_FOLDER & "\JPEG\" & ActiveDocumentName & "-" & i & ".jpg", cdrJPEG, cdrCurrentPage, Opt) Filter.Finish Next i End Sub