Heinz-Josef Bomanns
Posts: 206
Joined: 2008-02-28
|
Hi,
i have an ADXOlExplorerCommandBar with some buttons, works fine. I now try to add an existings built-in popup with ID 31289 (View/Arrange by) to this commandbar. If i add an ADXCommandBarPopup with this ID, nothing happens, if i add an ADXCommandBarControl with this ID i get an empty popup - what is the correct way to add an existing built-in popup to an ADXOlExplorerCommandBar? Thanks...__________________
Greetings, HJB
|
|
Eugene Astafiev
Guest
|
|
Heinz-Josef Bomanns
Posts: 206
Joined: 2008-02-28
|
Hi Eugene,
it's Outlook 2002 to 2007 - the problem is not covered in the documentation, wether online nor in the PDF version which i've read before i've posted my question. So what is the correct way to add an existing built-in popup to an ADXOlExplorerCommandBar? Thanks...__________________
Greetings, HJB
|
|
Eugene Astafiev
Guest
|
Hi Heinz-Josef,
Please note that there is no such popup (View | Arrange By) when you start Outlook. I.e. your control from the command bar can't be connected to the built-in one when the add-in starts. However, you may try to add such popups manually in the ExplorerFolderSwitch event handler. You just need to find the required controls (see the FindControl method of the CommandBars class in the Office Object Model) and then add them to the Controls collection. |
|
Heinz-Josef Bomanns
Posts: 206
Joined: 2008-02-28
|
Hi Eugene,
thanks, meanwhile i'v solved the problem in "AddinStartupComplete" like this:
Private Sub AddinModule_AddinStartupComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.AddinStartupComplete
Dim cb As Office.CommandBar
Dim pu, pu30124 As Office.CommandBarPopup
On Error Resume Next
If Me.HostMajorVersion < 14 Then '2007, 2003, 2002
cb = gobjOutlook.ActiveExplorer.CommandBars("Menu Bar")
pu30124 = cb.FindControl(Id:=30124, Recursive:=True)
cb = gobjOutlook.ActiveExplorer.CommandBars(adxSTPCmdBar.CommandBarName)
pu30124.Copy(cb)
End If 'Version?
End Sub 'AddinStartupComplete
It simply copies the existing popup to my ADXOlExplorerCommandBar, Outlook automatically keeps track that the contents of the popup is updated when folders are switched...__________________
Greetings, HJB
|
|
Eugene Astafiev
Guest
|
Good news, Heinz-Josef! You broke the ice!
Thank you for sharing the solution for other forum readers and good luck with your add-in project! |
|