Hi, i have a problem and it's driving me nuts. I have some corel files with print grid layer button turned on and it's impossible to turn it off.
This have a secondary effect and it's corel hangs up when i try to print the file, start to make the "previous checkings" and never ends.
I'm desesperate, any of you can you help me please?
Thanks
Capture of the problematic files:
Capture of a normal corel file:
:
A normal user can make the grid layer visible/invisible. However Printable or editable attributes can be changed with VBA only. It seems that you have run a macro which has changed the attributes. Try this code. I have not tried it on my DRAW but this should work.
Private Sub GridNoPrint()
Dim doc As DocumentDim lyr As Layer
Set doc = CorelDRAW.ActiveDocument
For Each lyr In doc.MasterPage.LayersIf lyr.Name = "Grid" Thenlyr.Printable = FalseEnd IfNext
End Sub
Anand thank you very much for your reply.
I have tested your code and doesn't work. I create a new macro, paste the code in it and execute but nothing happens.
Maybe i'm doing something wrong?
Thank you in advance
Ok here is the .GMS file with a tiny form for your convenience. Paste the file at C:\Program Files\Corel\CorelDRAW Graphics Suite X5\Draw\GMS. If you are using Win 7 then the path could be slightly different.
Anand, seriously, One Million of thanks to you for all your help and dedication.
This will be very useful to me.
Happy New Year!
Nice I could help you.
TassaDarK said: This will be very useful to me.
Happy new year
I just went through this on a file; the thing is I could not print from the file to see the grid; the only way I new that is I thought to convert it to a PDF from within Coreldraw. Also on one computer the file would not even open.
I could not find your attachment but did somehow manage to make your code run - I really did not know how to create a macro with the code you had and after managing it could not do it again. Consequently I tried a couple of additional things for future.
What worked for me on a copy of the bad file was to "hold F8 and click to start Corel and reset preferences to default"
Then when starting the file I was warned of a Macro so disabled it.
Unfortunately it will still save with the Macro
However if you save with a new name, when you go to save there is extra wording in the save area with a checkmark on
"Save Macro"
I removed the check mark and saved - and after the warning about loosing the Macro I was able to save it and no more Macro.
Then deleted the original file with bad macro.
There may be an easier way for future - I went into user settings and under
Tools
Options
Wokspace
VBA
One can turn off - trust Macros, or optionally under
Security
One can raise the security level which is by default medium.
Hope this helps the next victim. Or me if I forget what I did in a years time and have another file go bad. Of note I had recently reinstalled Corel X4 and forgot to add the SP2 patch, it may have been responsible for corrupting the file because of opening without the patch.
Thanks,
Ken
i can't use this macro, the run button is already pressed. nothing happens
Check this thread for additional information.