<?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 : How to load 2 commandbars from xml files</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : How to load 2 commandbars from xml files]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 20:21:37 +0000</pubDate>
  <lastBuildDate>Tue, 29 May 2012 14:55:14 +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=19810</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[How to load 2 commandbars from xml files : thanks, but how would I load 2...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=19810&amp;PID=68356&amp;title=how-to-load-2-commandbars-from-xml-files#68356</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5927">xfsriddler</a><br /><strong>Subject:</strong> 19810<br /><strong>Posted:</strong> 29 May 2012 at 2:55pm<br /><br />thanks, but how would I load 2 different tool bars on the same<div>form ?</div>]]>
   </description>
   <pubDate>Tue, 29 May 2012 14:55:14 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=19810&amp;PID=68356&amp;title=how-to-load-2-commandbars-from-xml-files#68356</guid>
  </item> 
  <item>
   <title><![CDATA[How to load 2 commandbars from xml files : Public Sub SaveXMLString(fileName...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=19810&amp;PID=68355&amp;title=how-to-load-2-commandbars-from-xml-files#68355</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=369">SuperMario</a><br /><strong>Subject:</strong> 19810<br /><strong>Posted:</strong> 29 May 2012 at 2:45pm<br /><br /><div>Public Sub SaveXMLString(fileName As String)</div><div><br></div><div>Dim FreeF As Integer, sFile As String, sLayout As String</div><div>Dim XMLLayout As String</div><div><br></div><div>On Error Resume Next:</div><div><br></div><div>&nbsp; &nbsp; 'Creates a string containing the CommandBars layout, state, and settings. &nbsp;The state options stored in the myStateOptions</div><div>&nbsp; &nbsp; 'object specifies which settings should be saved to the string. &nbsp;To allow the XML file to be opened in the Designer Studio,</div><div>&nbsp; &nbsp; 'the profile name MUST be set to "DesignerFile"</div><div>&nbsp; &nbsp; XMLLayout = CommandBars.SaveStateToXMLString("DesignerFile", myStateOptions)</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; 'XML string will be saved to a xml file. &nbsp;Note that the file extension is .XML. &nbsp;Opening a file</div><div>&nbsp; &nbsp; 'of type XML in a web browser will correctly format the XML sting.</div><div>&nbsp; &nbsp; sFile = fileName</div><div>&nbsp; &nbsp; FreeF = FreeFile</div><div>&nbsp; &nbsp; Kill sFile</div><div>&nbsp; &nbsp; Open sFile For Binary As #FreeF</div><div>&nbsp; &nbsp; Put #FreeF, , XMLLayout</div><div>&nbsp; &nbsp; Close #FreeF</div><div>End Sub</div><div><br></div><div>Public Sub LoadXMLString(fileName As String)</div><div><br></div><div>Dim FreeF As Integer, sFile As String, sLayout As String</div><div>Dim XMLLayout As String</div><div><br></div><div>On Error Resume Next:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; 'XML string will be loaded from the file.</div><div>&nbsp; &nbsp; sFile = fileName</div><div>&nbsp; &nbsp; FreeF = FreeFile</div><div>&nbsp; &nbsp; XMLLayout = Space(FileLen(sFile))</div><div>&nbsp; &nbsp; Open sFile For Binary As #FreeF</div><div>&nbsp; &nbsp; Get #FreeF, , XMLLayout</div><div>&nbsp; &nbsp; Close #FreeF</div><div>&nbsp; &nbsp; On Error GoTo 0</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; If (Not bSaveOnlyCustomized And bSerializeControls) Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; 'This is needed when the entire toolbar layout is loaded, not just user customization.</div><div>&nbsp; &nbsp; &nbsp; &nbsp; 'When the layout is loaded, the toolbars not present in the saved layout will not be deleted.</div><div>&nbsp; &nbsp; &nbsp; &nbsp; 'So you must manually remove all toolbars before loading a layout.</div><div>&nbsp; &nbsp; &nbsp; &nbsp; 'NOTE: The XML file must have been saved with bSaveOnlyCustomized = False And bSerializeControls = True</div><div>&nbsp; &nbsp; &nbsp; &nbsp; 'or the layout will not load properly.</div><div>&nbsp; &nbsp; &nbsp; &nbsp; CommandBars.DeleteAll</div><div>&nbsp; &nbsp; End If</div><div><br></div><div>&nbsp; &nbsp; 'Load the "DesignerFile" profile from the myXMLLayout string. &nbsp;The state options stored in the</div><div>&nbsp; &nbsp; 'myStateOptions object specify how and what to restore of the Command Bars settings.</div><div>&nbsp; &nbsp; CommandBars.LoadStateFromXMLString "DesignerFile", XMLLayout, myStateOptions</div><div>End Sub</div><div><br></div><div>Private Sub xmlFileLoad()</div><div>&nbsp; &nbsp; Dim sFile As String</div><div><br></div><div>&nbsp; &nbsp; With dlgCommonDialog</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .InitDir = App.Path</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .DialogTitle = "Load XML Layout"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .CancelError = False</div><div>&nbsp; &nbsp; &nbsp; &nbsp; 'ToDo: set the flags and attributes of the common dialog control</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Filter = "xml Files (*.xml)|*.xml"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .ShowOpen</div><div>&nbsp; &nbsp; &nbsp; &nbsp; If Len(.fileName) = 0 Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Exit Sub</div><div>&nbsp; &nbsp; &nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; &nbsp; &nbsp; sFile = .fileName</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; LoadXMLString (sFile)</div><div>&nbsp; &nbsp;&nbsp;</div><div>End Sub</div><div><br></div><div>Private Sub xmlFileSave()</div><div>&nbsp; &nbsp; Dim sFile As String</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; With dlgCommonDialog</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .InitDir = App.Path</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .DialogTitle = "Save XML Layout"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .CancelError = False</div><div>&nbsp; &nbsp; &nbsp; &nbsp; 'ToDo: set the flags and attributes of the common dialog control</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Filter = "xml Files (*.xml)|*.xml"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .ShowSave</div><div>&nbsp; &nbsp; &nbsp; &nbsp; If Len(.fileName) = 0 Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Exit Sub</div><div>&nbsp; &nbsp; &nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; &nbsp; &nbsp; sFile = .fileName</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; SaveXMLString (sFile)</div><div><br></div><div>End Sub</div>]]>
   </description>
   <pubDate>Tue, 29 May 2012 14:45:10 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=19810&amp;PID=68355&amp;title=how-to-load-2-commandbars-from-xml-files#68355</guid>
  </item> 
  <item>
   <title><![CDATA[How to load 2 commandbars from xml files : I am having a difficult time finding...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=19810&amp;PID=68342&amp;title=how-to-load-2-commandbars-from-xml-files#68342</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5927">xfsriddler</a><br /><strong>Subject:</strong> 19810<br /><strong>Posted:</strong> 24 May 2012 at 3:54pm<br /><br />I am having a difficult time finding any documentation on the<div>procedure for loading a toolbar from a saved xml file.</div><div>I need to have 2 toolbars on the bottom of my form that</div><div>are loaded from 2 different xml files.</div><div>Can you provide a simple example that</div><div>I can use to do this ?</div>]]>
   </description>
   <pubDate>Thu, 24 May 2012 15:54:05 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=19810&amp;PID=68342&amp;title=how-to-load-2-commandbars-from-xml-files#68342</guid>
  </item> 
 </channel>
</rss>