<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Add CommandBarControl Before Item</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Add CommandBarControl Before Item]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Mon, 27 Apr 2026 04:26:00 +0000</pubDate>
  <lastBuildDate>Mon, 02 Jun 2008 19:59:36 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=10875</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Add CommandBarControl Before Item : Okay, the magic potion was: CommandBar.Controls.Add...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10875&amp;PID=36153&amp;title=add-commandbarcontrol-before-item#36153</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 10875<br /><strong>Posted:</strong> 02 June 2008 at 7:59pm<br /><br />Okay, the magic potion was:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>CommandBar.Controls.Add xtpControlButton, CMD_PrinterDevice + i, dictPrinters.KeyByIndex(i), CommandBar.Controls.Count<br></pre></td></tr></table><br><br>]]>
   </description>
   <pubDate>Mon, 02 Jun 2008 19:59:36 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10875&amp;PID=36153&amp;title=add-commandbarcontrol-before-item#36153</guid>
  </item> 
  <item>
   <title><![CDATA[Add CommandBarControl Before Item : Hi,I&amp;#039;ve been trying to add...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10875&amp;PID=36152&amp;title=add-commandbarcontrol-before-item#36152</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 10875<br /><strong>Posted:</strong> 02 June 2008 at 7:55pm<br /><br />Hi,<br><br>I've been trying to add a CommandBarControl before an existing item in a dynamically generated menu...<br><br>I have a QuickAccess control set up as follows (this works fine):<br><br><table width="99%"><tr><td><pre class="BBcode"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set objQA = mobjRibbonBar.QuickAccessControls.Add(xtpControlSplitButtonPopup, CMD_Print, "Print")<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objQA.CommandBar.BarID = CMD_Print<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; With objQA.CommandBar.Controls<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set objCtrl = .Add(xtpControlLabel, CMD_PrinterDeviceLabel, "Available Printers")<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set objCtrl = .Add(xtpControlButton, CMD_PrintSetup, "Print Setup")<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objCtrl.BeginGroup = True<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End With<br></pre></td></tr></table><br><br>Now I want to dynamically populate a list of available printers between the CMD_PrinterDeviceLabel and CMD_PrintSetup controls. I'm using the InitCommandsPopup event to capture when the CMD_Print QA control drop down button has been pressed as follows:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>Private Sub CommandBars1_InitCommandsPopup(ByVal CommandBar As XtremeCommandBars.ICommandBar)<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; Dim i As Long<br>&nbsp;&nbsp; Dim objCtrl As CommandBarControl<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; Select Case CommandBar.BarID<br>&nbsp;&nbsp; Case CMD_Print<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  ' Lots of code not shown to show/hide printers dynamically<br>&nbsp;&nbsp; End Select<br></pre></td></tr></table><br><br>This also works okay, except when I add a printer to the list, it always appears below the CMD_PrintSetup control. I've tried:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>CommandBar.Controls.Add xtpControlButton, CMD_PrinterDevice + i, Printers(i).DeviceName, CMD_PrintSetup<br></pre></td></tr></table><br><br>And<br><br><table width="99%"><tr><td><pre class="BBcode"><br>CommandBar.Controls.Add xtpControlButton, CMD_PrinterDevice + i,Printers(i).DeviceName, CommandBar.FindControl(, CMD_PrintSetup).Index<br></pre></td></tr></table><br><br>And<br><br><table width="99%"><tr><td><pre class="BBcode"><br>CommandBar.Controls.Add xtpControlButton, CMD_PrinterDevice + i,Printers(i).DeviceName, CommandBar.FindControl(, CMD_PrintSetup)<br></pre></td></tr></table><br><br><br>Without success (the printer device names always get added below the CMD_PrintSetup control). Is there a way to accomplish this?<br><br>Thanks in advance.<br>]]>
   </description>
   <pubDate>Mon, 02 Jun 2008 19:55:22 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10875&amp;PID=36152&amp;title=add-commandbarcontrol-before-item#36152</guid>
  </item> 
 </channel>
</rss>