abort Method

Microsoft FrontPage Visual Basic

abort Method

Stops execution of the specified FPHTMLUndoTransaction object. For example, if you're running a macro and you've previously created an FPHTMLUndoTransaction object for the macro, you can use the abort method to stop the macro when an error condition results.

expression.abort

expression    An expression that returns an FPHTMLUndoTransaction object.

Remarks

Once an FPHTMLUndoTransaction object is created, Microsoft FrontPage places the name of the FPHTMLUndoTransaction object in the Undo command on the Edit menu.

Example

Use the createUndoTransaction method of the IFPDocument object to create an FPHTMLUndoTransaction object. The String argument passed in with the createUndoTransaction method is added to the Undo command on the Edit menu when the Commit method is called. The following example creates an FPHTMLUndoTransaction object illustrating the abort and Commit methods.

    Private Sub CreateUndoTransaction()
    Dim objDoc As FPHTMLDocument
    Dim objTansaction As FPHTMLUndoTransaction
    
    On Error GoTo CreateUndoTransactionError
    
    Set objDoc = ActiveDocument
    Set objTansaction = objDoc _
        .CreateUndoTransaction("Last Macro")
    
    objDoc.body.insertAdjacentHTML "BeforeEnd", _
        "<b>Added by FP Programmability</b>"
    
    objTansaction.Commit

ExitCreateUndoTransaction:
    Exit Sub
    
CreateUndoTransactionError:
    objTansaction.abort
    GoTo ExitCreateUndoTransaction
End Sub