I have a document template that works perfectly in Word 2007. There is a custom UI that adds a tab with a few controls to the ribbon. The user uses these controls and any built-in ones necessary to assemble a document in a particular form, then saves it. The document is saved WITHOUT the custom UI, since it is not necessary. The custom code mostly invokes a few XSL transforms, so there is no functionality that I want to carry along with the completed document - once the transform runs, my code is finished - any further dolling up is done with standard controls, always available in any document.
I use the following code to intercept the Save and SaveAs... functions:
Public Sub FileSave()
ActiveDocument.AttachedTemplate = ""
Dialogs(wdDialogFileSaveAs).Show
End Sub
Public Sub FileSaveAs()
ActiveDocument.AttachedTemplate = ""
Dialogs(wdDialogFileSaveAs).Show
End Sub
In Word 2007, this works fine, the custom tab on the ribbon disappears and the document is saved without it. But in Word 2010, the tab stays, even though the underlying code disappears, resulting in load errors every time the finished document is opened, or when a (no longer functional) button is clicked on the custom tab.
The document is generated fine, but this inability to remove the custom ribbon tab results in a very tacky-looking finished product. How do I make this custom tab go away completely in 2010?
Pete