Dear fellows,
with the help of MS-Copilot I made a VBA script that deletes NAME tags and finally exports the result as a CGM file. This is a WebCGM 2.1 profile currently used, but I have to switch to the profile "S1000D_5.0" for compatibility reasons.
I have no idea how to do this and I am running against a wall asking Copilot for help on this.
I am not experienced in VBA coding, to be honest.
Thanks for your input and time.
Kind regrads, Bernd
Hi Bernd,
you're asking for Corel DESIGNER functionality - I want to highlight that again as most discussions in this forum are about CorelDRAW automation. CGM export in Corel DESIGNER provides additional functionality, including CGM V4 and specifically WebCGM and other advanced profiles beyond what's found in CorelDRAW for CGM export.
For S1000D (5.0) CGM export, you may want to have a look at the CGMExport.Format property. In there, you see the CGM format enumeration with values 0 - 19 (in Corel DESIGNER 2025). S1000D Issue 5.0 is "cgmS1000dIssue5_0" = 19
Here's VBA sample code using that CGMExport.Format property value:
Dim OrigSelection As ShapeRange Set OrigSelection = ActiveSelectionRange OrigSelection.CreateSelection Dim expopt As StructExportOptions Set expopt = CreateStructExportOptions expopt.UseColorProfile = False Dim expflt As ExportFilter Set expflt = ActiveDocument.ExportEx("\\device\path\targetfilename.cgm", cdrCGM, cdrSelection, expopt) With expflt .Format = 19 ' FilterCGMLib.cgmS1000dIssue5_0 .FileEncoding = 0 ' FilterCGMLib.cgmBinary .ICN = "" .GNBR = "" .OutputPrecision = 1 ' FilterCGMLib.cgmReal32bit .CharsetMode = 0 ' FilterCGMLib.cgmStrict .FallbackCode = 0 ' FilterCGMLib.cgmUseUTF8 .TextEncoding = 0 ' FilterCGMLib.cgmTextISO8859_1 .ColorMode = 1 ' FilterCGMLib.cgmDirectColor .ExportLayers = False .IncludeXCF = True .Finish End With
Best regards,Klaus
Dear Klaus,
Thank you very much for your help and efforts. I am sorry for the long delay, but I had no time coming back to this issue.
With your code snippet I was able to solve my problem. Cool!
All the best,Bernd