bstephens
07-28-2010, 12:33 AM
I re-purposed my "save" command as follows:
'REPURPOSED SAVE COMMAND - Automatically updates the field upon a file SAVE event
Sub FileSave()
ActiveDocument.Save
End Sub
'Callback for FileSave onAction
Sub rxFileSave_repurpose(control As IRibbonControl, ByRef cancelDefault)
Call FileSave
Call UpdateAllFields
End Sub
This code works fine if you save the document, but if it is a new document (not yet saved) and you hit "cancel", it gives the error:
Run-time error '4198':
Command failed
Is there a way to make the function just exit out if the user hits cancel and the document is not yet saved, instead of getting the error 4198?
Best,
Brian
'REPURPOSED SAVE COMMAND - Automatically updates the field upon a file SAVE event
Sub FileSave()
ActiveDocument.Save
End Sub
'Callback for FileSave onAction
Sub rxFileSave_repurpose(control As IRibbonControl, ByRef cancelDefault)
Call FileSave
Call UpdateAllFields
End Sub
This code works fine if you save the document, but if it is a new document (not yet saved) and you hit "cancel", it gives the error:
Run-time error '4198':
Command failed
Is there a way to make the function just exit out if the user hits cancel and the document is not yet saved, instead of getting the error 4198?
Best,
Brian