Consulting

Results 1 to 3 of 3

Thread: Callbacks not working

  1. #1

    Callbacks not working

    I have two templates for Word and they both work in version 2010.

    The first template has the following schema:
    [vba]<customUI
    onLoad="Ribbon_OnLoad"
    xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <ribbon startFromScratch="false">
    <tabs>[/vba]
    and the following togglebutton code:

    [vba]<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" />[/vba]
    The second template has this schema:
    [vba]<customUI
    onLoad="rxIRibbonUI_OnLoad"
    xmlns="http://schemas.microsoft.com/office/2009/07/customui">
    <ribbon startFromScratch="false">
    <tabs>[/vba] and both callbacks have the same structure albeit with different ID names just to avoid confusion:

    [vba]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[/vba]
    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

  2. #2
    VBAX Regular
    Joined
    Jul 2012
    Posts
    29
    Location
    Could you upload your Word document please with Image

    Janine
    Last edited by jec1; 06-06-2013 at 05:08 AM. Reason: Wrong answer

  3. #3
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,724
    Location
    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
    Attached Images Attached Images
    Last edited by Paul_Hossler; 06-07-2013 at 07:49 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •