I have noticed the increasing file size of my projects over the past couple months and have found that there are many unused symbols lurking in the files. I have a vba macro to delete unused symbols from a file, but am looking to have that macro run when a file is opened. I figure if I can get this set up I can run file converter on the ~1000 files that need to have the symbols removed. Can anyone help with vba to run the macro on open and close the file after? The code I am using now is
Sub delete()
Dim i As Integer
On Error Resume NextFor i = ActiveDocument.SymbolLibrary.Symbols.Count To 1 Step -1 ActiveDocument.SymbolLibrary.Symbols.Item(i).deleteNext iOn Error GoTo 0End Sub
Open macro editor.
double-click GlobalMacros (GlobalMacros.gms).
double-click CorelDRAW X6 Objects
double click ThisMacroStorage.
Left drop down choose GlobalMacroStorage.
Right drop down choose DocumentOpen.
Drop your code in between the tags.
Add another for close as necessary
Test before choosing to save in edito
Hi Myron,
My issue is After completing designing work in Corel designer I have to generate (export) out file in .cgm format. before exporting I need to convert all text in my file to curves (ctrl+Q). For converting a number of files to .cgm I am using File converter in the Macro manager. But, to convert the text into Curves every time I need to open each file.
I Found a thread, in which gave a solution to place the macro in file converter code.
I have the Macro to convert Text to Curves. But, I'm not able to identify the exact location in the File converter code to place the Text to Curves Macro.
Could you please help me with this issue. It means a lot to me.
Sub allTexttoCurves()For i = 1 To ActiveDocument.Pages.CountActiveDocument.Pages(i).ActivateSet sr = ActivePage.Shapes.AllIf sr.Count > 0 ThenActivePage.Shapes.FindShapes(Query:="@type = 'text:artistic'").ConvertToCurvesActivePage.Shapes.FindShapes(Query:="@type = 'text:paragraph'").ConvertToCurvesEnd IfNext iEnd Sub
Thanks in Advance.
Best Regards,
Naveen
Sorry, this is beyond my vba "hacking" skills.
The FileConverter I see in X7 - which is the oldest version of CorelDRAW I have - has a checkbox for "Convert Text To Curves".