0 Replies Latest reply on Jun 26, 2008 8:50 AM by (Archie_Tucker)

    Terminating VB Script after an Error

    Level 1
      A simple question that I cannot find the answer too. Below is an section of code to show what I'm looking for. I need to display a error message and then exit the script, what is the command to exit the VBscript?

      Function myDuplicateStyle (myInDesign, myDocument)


      On Error Resume Next
      myStyleDocument.PageItems.item(myStyleNumber).duplicate myDocument.Pages.Item(1)
      If Error.Number <> 0 Then
      MsgBox "Custom Style Number " & myStyleNumber & " Missing From Custom Style Document"
      *** What goes here? ***
      End If


      End Function