Hi. I have this code and it runs okay as long as I don't have too many pages with graphics on them. I can re-create the crash many times and would like to know if there is something else I can add to this so that the crash does not happen. Maybe something that will check when the page deletion process is taking longer than normal and the macro will pause to allow processing?
Dim s As Shape For Each pageThis In ActiveDocument.Pages Set sPageNumThis = pageThis.Shapes.FindShape("pagetotal") If Not sPageNumThis Is Nothing Then sPageNumThis.Text.Story = CStr(ActiveDocument.Pages.Count) End If Next pageThis
last thing. using the DocumentBeforeSave but I'm not sure how to implement.
Private Sub GlobalMacroStorage_DocumentBeforeSave(ByVal Doc As Document, ByVal Window As Window) Set CurDoc = DocEnd Sub
I get this error:
Since you are already using other code to get the document - with events - then you could try using something like this:
Private Sub CurDoc_BeforeSave(ByVal SaveAs As Boolean, ByVal FileName As String) update End Sub
Darn. This did not work out so well after all. The temporary disable function would stay stuck on disable could not get it to work. I can't get the 'ThisMacroStorage' section of the macro to work correctly without crashing coreldraw. I'll need to change my approach.