Roderick
06-04-2013, 09:57 AM
I have two templates for Word and they both work in version 2010.
The first template has the following schema:
<customUI
onLoad="Ribbon_OnLoad"
xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="false">
<tabs>
and the following togglebutton code:
<toggleButton id="tbToggleDraft"
label="DRAFT"
size="large"
screentip="DRAFT notation"
supertip="Adds or removes the DRAFT notation from the active document."
keytip="D"
getPressed="tbToggleDraft_GetPressed"
getImage="tbToggleDraft_GetImage"
onAction="tbToggleDraft_OnAction" />
The second template has this schema:
<customUI
onLoad="rxIRibbonUI_OnLoad"
xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="false">
<tabs> and both callbacks have the same structure albeit with different ID names just to avoid confusion:
Sub rxtbtnTogDraft_GetPressed(ByVal control As IRibbonControl, ByRef returnVal)
returnVal = ActiveDocument.CustomDocumentProperties("ToggleDraft")
End Sub
Sub rxtbtnTogDraft_GetImage(control As IRibbonControl, ByRef returnedVal)
Dim oDraft As Boolean
Select Case oDraft = ActiveDocument.CustomDocumentProperties("ToggleDraft")
Case True
returnedVal = "ReviewEditComment"
Case False
returnedVal = "DeclineInvitation"
End Select
End Sub
In essence, they are exactly the same. In the first template with the Word 12 schema the GetPressed and GetImage work perfectly.
However, with the Word 14 schema both callbacks have no influence on the togglebutton.
Is there something different with the schemas which I haven't noticed?
Would appreciate some comments in case I've made a drastic mistake.
Roderick
The first template has the following schema:
<customUI
onLoad="Ribbon_OnLoad"
xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="false">
<tabs>
and the following togglebutton code:
<toggleButton id="tbToggleDraft"
label="DRAFT"
size="large"
screentip="DRAFT notation"
supertip="Adds or removes the DRAFT notation from the active document."
keytip="D"
getPressed="tbToggleDraft_GetPressed"
getImage="tbToggleDraft_GetImage"
onAction="tbToggleDraft_OnAction" />
The second template has this schema:
<customUI
onLoad="rxIRibbonUI_OnLoad"
xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="false">
<tabs> and both callbacks have the same structure albeit with different ID names just to avoid confusion:
Sub rxtbtnTogDraft_GetPressed(ByVal control As IRibbonControl, ByRef returnVal)
returnVal = ActiveDocument.CustomDocumentProperties("ToggleDraft")
End Sub
Sub rxtbtnTogDraft_GetImage(control As IRibbonControl, ByRef returnedVal)
Dim oDraft As Boolean
Select Case oDraft = ActiveDocument.CustomDocumentProperties("ToggleDraft")
Case True
returnedVal = "ReviewEditComment"
Case False
returnedVal = "DeclineInvitation"
End Select
End Sub
In essence, they are exactly the same. In the first template with the Word 12 schema the GetPressed and GetImage work perfectly.
However, with the Word 14 schema both callbacks have no influence on the togglebutton.
Is there something different with the schemas which I haven't noticed?
Would appreciate some comments in case I've made a drastic mistake.
Roderick