OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   CorelDRAW/Corel DESIGNER VBA (http://forum.oberonplace.com/forumdisplay.php?f=16)
-   -   Why always dirty? X6 (no SPs) (http://forum.oberonplace.com/showthread.php?t=24728)

knowbodynow 06-05-2015 20:04

Why always dirty? X6 (no SPs)
I made a macro to speed up common printing jobs. It seems the first time it runs it crashes CorelDraw. I'm trying to find out why. I added a check so that it would only run if the document isn't dirty. But with the following code it is always coming up dirty. Can anyone tell me why:


Sub QuickPrint()

    For Each p In ActiveDocument.Pages
        p.AllLayers("Document Grid").Printable = False
'        p.AllLayers("Desktop").Printable = False
'        p.AllLayers("Guides").Printable = False
'        p.Layers("Guides").Printable = False

    Next p
    If ActiveDocument.Dirty = True Then
    MsgBox "Please save document before printing", vbOKOnly, "Oops!"
    Exit Sub
    End If


End Sub

I would only expect a message if some change was being made but I've run tests and I get the message everytime. How to check whether certain layers are printable without making the document dirty? Thanks

shark 07-05-2015 04:16

May be first check
If ActiveDocument.Dirty = False
and then make all grid/guides/desktop layers are not printable and call frmQuickPrint.Show?

ddonnahoe 08-05-2015 07:13

Yes, Shark is correct. By cycling through your For...Each loop, you 'Dirty' the document. You should do a check before, or save the document right after you turn off your layers.

knowbodynow 13-05-2015 19:22

Thanks, I've tried both methods but CorelDraw is still crashing. It seems the first time I run tmy macro CorelDraw crashes but then it is OK. Does this suggest anything to anyone?

ddonnahoe 14-05-2015 07:18

I've also seen Draw crash during a print operation. What version are you using? Are you using any saved print profiles?

knowbodynow 15-05-2015 19:23

I'm using plain X6 without any service packs. I hadn't got as far as incorporating print profiles but that was my intention.

ddonnahoe 18-05-2015 07:30

Hmmm... Can't say I remember much from X6 print crashing, but in X7 It happens to me a lot. I've resorted to exporting any print jobs to PDF and printing them from Acrobat. I'll ask someone from Corel to look into this.

All times are GMT -5. The time now is 03:32.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com