Add built-in popup to ADXOlExplorerCommandBar...

Add-in Express™ Support Service
That's what is more important than anything else

Add built-in popup to ADXOlExplorerCommandBar...
 
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
Posted 15 Aug, 2011 04:23:19 Top
Eugene Astafiev


Guest


Hi Heinz-Josef,

What Outlook version do you use? Anyway, please take a look at the http://www.add-in-express.com/docs/net-commandbar-components.php section in the online documentation.

BTW What version and build number of Add-in Express do you use?
Posted 15 Aug, 2011 10:18:05 Top
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
Posted 15 Aug, 2011 12:38:04 Top
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.
Posted 17 Aug, 2011 08:16:23 Top
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
Posted 18 Aug, 2011 00:03:57 Top
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!
Posted 18 Aug, 2011 02:27:00 Top