Skip to Main Content
Word 2007 Document Automation with VBA and VSTO
book

Word 2007 Document Automation with VBA and VSTO

by Scott Driza
March 2009
Intermediate to advanced content levelIntermediate to advanced
617 pages
17h 24m
English
Jones & Bartlett Learning
Content preview from Word 2007 Document Automation with VBA and VSTO
MsgBox "We are now at the next line."
Exit Sub
ErrTrap:
Dim iErr As Integer
iErr = Handler.GetError(Err.Number, Err.Description)
Select Case iErr
Case 1
MsgBox "This form will be re-initialized", vbOKOnly, "Error"
Unload Me
frmError.Show
Exit Sub
Case 2
Resume Point1
Case 3
Resume 0
Case 4
Resume Next
Case 5
MsgBox "Fatal error, all data will be lost!", vbCritical, _
"Error"
End
End Select
End Sub
Note: To extend this error handler even further, you can use
Visual Basic to create a DLL (COM object) that can be used with
any Component Object Model (COM)-compliant application.
Developer Error Handler Add-in
Word 2007 contains an error handler add-in that greatly sim-
plifies ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Word 2003 Document Automation with VBA, XML, XSLT, and Smart Documents

Word 2003 Document Automation with VBA, XML, XSLT, and Smart Documents

Scott Driza

Publisher Resources

ISBN: 9781598220476