PDA

View Full Version : Callbacks not working



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

jec1
06-06-2013, 02:26 AM
Could you upload your Word document please with Image

Janine

Paul_Hossler
06-07-2013, 07:36 PM
FWIW, the only difference I see in the little bit that was posted is that the first template is 2007 based (2006/01) and the second is 2010 based (2009/07)

When you created the CustomUI did you put the XML into the correct 'version'?

The 2007 XML into the CustomUI branch and the 2010 into the CustomUI14 branch?

Paul