Represents the cache where the actions performed by a macro are stored. The UndoTransaction object includes methods that continue or stop the specified transaction.
You can use the createUndoTransaction method of the IFPDocument object to create an UndoTransaction object. The following example creates an undo transaction illustrating the abort and commit methods.
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