Hi. On occasion, I get a program crash when I run this macro to pub a cdr to pdf. I don't what causes it and I lose work sometimes. If anyone can check this code I'd be so grateful.
Sub PublishToPdf() Dim dn As String, ps As PDFVBASettings Set ps = ActiveDocument.PDFSettings If ActiveDocument.Dirty Then ActiveDocument.Save On Error GoTo ErrHandler 'ps.ShowDialog dn = Left$(ActiveDocument.FullFileName, Len(ActiveDocument.FullFileName) - 4) & ".pdf" ActiveDocument.PublishToPdf dn dn = Left$(ActiveDocument.FullFileName, Len(ActiveDocument.FullFileName) - 4) & ".pdf" ExitSub: Exit Sub ErrHandler: MsgBox "Error occured: " & Err.Description & Err.Number Resume ExitSub End Sub
It's a little difficult to recreate the crashes so this updated code might help. I'll keep y'all posted on what happens in the next few days.
This new user of you is more concise...