I am new Corel and I am trying to do a Macro. I used the recording tool. I want to take a selection, convert to curves, turn it black then export it to ".dxf" in folder location. It works but I can't figure out how to make it so it has the same name as the active document. It always ends up with "778819.dxf".
I have been trying to figure it out myself but I am having a hard time since I am new to coding and I don't really understand how the "ActiveDocument" thing works.
Here is the code:
Sub DXF() ' Recorded 4/11/2016 Dim OrigSelection As ShapeRange Set OrigSelection = ActiveSelectionRange OrigSelection.ConvertToCurves OrigSelection.ApplyUniformFill CreateCMYKColor(0, 0, 0, 100) OrigSelection.CreateSelection Dim expopt As StructExportOptions Set expopt = CreateStructExportOptions expopt.UseColorProfile = False Dim expflt As ExportFilter Set expflt = ActiveDocument.ExportEx("F:\LASIT\_DXF Files\778819.dxf", cdrDXF, cdrSelection, expopt) With expflt .BitmapType = 0 ' FilterDXFLib.dxfBitmapJPEG .TextAsCurves = True .Version = 11 ' FilterDXFLib.dxfVersion2006 .Units = 3 ' FilterDXFLib.dxfMillimeters .FillUnmapped = True .FillColor = 0 .Finish End WithEnd Sub
You can try code below, export selection as dxf to the same directory as cdr file is saved
You are welcome.
Of course you can export to different folder, i.e. you want to save to folder
Change this line
fnp = ActiveDocument.FilePath
Wow, thats really helpful.
also, can it saved into .plt too ?
Yes, it can. What are your settings of plt export?