M
Montana DOJ Help Desk
Word 2000
I am working on an error handling routine. Initially, I was handling the
errors as follows:
If Err.Number = 5216 Or Err.Number = 5825 Then
Dialogs(wdDialogFilePrintSetup).Show
ActiveDocument.Variables("LocatesDefaultPrinter").Value =
ActivePrinter
End If
Resume Next
However, I just read about the Select Case statement. I re-wrote the above
code as shown below:
Select Case Err.Number
Case 5216, 5825
Dialogs(wdDialogFilePrintSetup).Show
ActiveDocument.Variables("LocatesDefaultPrinter").Value =
ActivePrinter
End Select
Resume Next
Both versions work, and seem to handle the errors equally well. Is there
any particular advantage to using Select Case?
-- Tom
State of Montana
Department of Justice Help Desk
"Making the world a safer place."
I am working on an error handling routine. Initially, I was handling the
errors as follows:
If Err.Number = 5216 Or Err.Number = 5825 Then
Dialogs(wdDialogFilePrintSetup).Show
ActiveDocument.Variables("LocatesDefaultPrinter").Value =
ActivePrinter
End If
Resume Next
However, I just read about the Select Case statement. I re-wrote the above
code as shown below:
Select Case Err.Number
Case 5216, 5825
Dialogs(wdDialogFilePrintSetup).Show
ActiveDocument.Variables("LocatesDefaultPrinter").Value =
ActivePrinter
End Select
Resume Next
Both versions work, and seem to handle the errors equally well. Is there
any particular advantage to using Select Case?
-- Tom
State of Montana
Department of Justice Help Desk
"Making the world a safer place."