Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Call CustomizeOption window by code
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Call CustomizeOption window by code

 Post Reply Post Reply
Author
Message
Bush View Drop Down
Newbie
Newbie


Joined: 06 September 2004
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bush Quote  Post ReplyReply Direct Link To This Post Topic: Call CustomizeOption window by code
    Posted: 08 September 2004 at 4:17am
Somebody knows how to call the "CustomizeOption Window" by code?
Back to Top
Boyd View Drop Down
Senior Member
Senior Member


Joined: 08 December 2003
Location: United States
Status: Offline
Points: 285
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boyd Quote  Post ReplyReply Direct Link To This Post Posted: 08 September 2004 at 7:59am

There's no straightforward way to do this.  My workaround is to create a dummy popup menu and then add a control to that menu that has the same ID as the 'Customize' control that appears on the built-in customize menu.  You can then use the 'Execute' method of that control to trigger the 'Customize' dialog.  I just wrapped the routine up in a function so that I can easily call it for any of my CommandBars instances.  I've been using this approach without any problems whatsoever.  Here's some sample code:

Public Function CustomizeToolbar(ByRef cb as CommandBars)
    Dim TempBar As CommandBar, Control As CommandBarControl
    If cb Is Nothing Then Exit Sub
    Set TempBar = cb.Add("Temp", xtpBarPopup)
    Set Control = TempBar.Controls.Add(xtpControlButton, 35001, "Temporary")
    Control.Execute
End Function

Simply call this function and pass a reference to the CommandBars object you want to customize.  Enjoy!!

Back to Top
Bush View Drop Down
Newbie
Newbie


Joined: 06 September 2004
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bush Quote  Post ReplyReply Direct Link To This Post Posted: 08 September 2004 at 8:29am

Thx a lot Boyd, I added .Add(xtpControlButton, 35001, "Adapt...") in the frmLoad and it works.

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.