abort Method

       

Stops the transaction. For example, if you're running a macro and you've previously created an undo transaction for the macro, you can programmatically use the abort method to stop the macro when an error condition results.

expression.abort

expression   An expression that returns a FPHTMLUndoTransaction object.

Return Type

Void

Remarks

If an error condition occurs that invalidates a transaction object, you can use the abort method to stop the transaction.

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

Example

The following example creates a transaction, performs an operation that adds the operation to the stack, and then requires a response from the user that either aborts the operation or commits it.

Private Sub CreateTransaction()
Dim myTrans As FPHTMLUndoTransaction
Dim myDoc As FPHTMLDocument
Dim myUTransName As String
Dim myMsg As String

Set myDoc = ActiveDocument
myUTransName = "Undo Last Macro"
Set myTrans = _
    myDoc.createUndoTransaction(myUTransName)
myMsg = "Would you like to cancel the operation?"

Call myDoc.body.insertAdjacentHTML("BeforeEnd", _
    "<b> Added by FP Programmability </b>")

Answer = MsgBox(myMsg, vbYesNo, "Cancel Operation?")
If Answer = vbYes Then
    myTrans.abort
Else
    myTrans.commit
End If
End Sub