This project has moved. For the latest updates, please go here.

Riboon UI With Classic UI in Office 2003

Dec 11, 2014 at 3:00 AM
Edited Dec 11, 2014 at 3:16 AM
The Ribbon functions fire correctly.
but when I create user interface for 2003, the CommandBarButton with clickevent hanlder fires in a wrong way.
I added two Button in my popup controls, and AddHandler for each button. The CommandBar Buttons showed correctly, but when I clicked the button, the Sub of each button called from start to end ( Sub 1, Sub 2, ...)
Is this a bug when used two UIs? Is there any example to display two UIs in different Offices?

Best Regards,
Penn Ye.
Dec 12, 2014 at 11:08 AM
The ribbon ui is completly seperated from the classic ui. no chance for side effects so far.
please post a code snippet and/or try the NO classic UI examples. (btw which office product?)

Dec 16, 2014 at 1:21 PM
Edited Dec 16, 2014 at 1:22 PM
A free addin to improve powerpoint fuctions. I used vsto before, and transfered all code to NO.

Code for Ribbon:
    Public Overrides Function GetCustomUI(RibbonID As String) As String
        App = NetOffice.PowerPointApi.Application.GetActiveInstance()
        AppVersion = Val(App.Version)
        If AppVersion < 14 Then
            Return GetResourceText("Ribbon07.xml")
            Return GetResourceText("Ribbon10.xml")
        End If
    End Function
Code for Create Classic UI
        Dim cbBtn As CommandBarButton
        cbBtn = cbMenuControls.Add(MsoControlType.msoControlButton, Nothing, Nothing, Nothing, True)
        With cbBtn
            .Style = MsoButtonStyle.msoButtonIconAndCaption
            .Picture = CovertPictureToIPictureDisp.FromImage(My.Resources.ResourceManager.GetObject(Picture))
            .Tag = Tag
            .DescriptionText = DescriptionText
            .BeginGroup = BeginGroup
            AddHandler .ClickEvent, OnAction
        End With
Code for the ClickEvent handler:
    Private Sub ClassicButton_Click(Ctrl As CommandBarButton, ByRef CancelDefault As Boolean)
    End Sub
The code works when only one button in the classic ui.However, it cannot fire correctly with more buttons.

Best Regards,
Penn Ye.