简体   繁体   English

ms Access 2007中的XML

[英]xml in ms access 2007

I'm trying to add ribbons in ms access 2007 by creating USysRibbons and adding xml code in it: 我试图通过创建USysRibbons并在其中添加xml代码在ms Access 2007中添加功能区:

Here is my code: 这是我的代码:

 <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"    onLoad="MyOnLoad"> 
 <ribbon startFromScratch="false"> <tabs> <tab id="Tab1" 
 label="My Tabs"    insertAfterMso="TabDatabaseTools">
 <group id="Group1" label="Buchbeispiel Gruppe"  supertip="Hier ist der ScreenTip"><menu id="Menu1" label="My First Menu"  itemSize="normal">
<button id="button1" label="Normal Button" imageMso="Risks" />
<toggleButton id="toggleButton1" label="A toggle Button" /><button id="button2" label="Click me" onAction="OnButtonClick" />
<menu id="menu2" label="Under menu" itemSize="large" ><button id="button3" label="Click the button3" imageMso="FormatPainter"  onAction="OnButtonClick" />
<button id="button4" label="Normal Button" imageMso="Risks" />
<menuSeparator id="sep2" title="Separator mit Text" />
<toggleButton id="toogleButton2" imageMso="HappyFace" 
label="A toggle Button"  description="Hiermit lassen sich Optionen auswahlen"/>
</menu>
</menu>
</group>
</tab>
<tab id="Tab2" label="My Second Tab" insertAfterMso="Tab1">
<group id="Group2" label="Example 2" supertip="Hier ist der ScreenTip">
</group>
</tab>
</tabs>
</ribbon>
</customUI>

But if I tried to add the tab id "Tab2" insert after Tab1 I'm getting an error: 但是,如果我尝试在Tab1之后添加选项卡ID“ Tab2”,则会出现错误:

    Error found in CUSTOM UI XML of C:\….Line 2Column 
    33ErrorCode 0X80004005Unknown   Office control ID: Tab1

What if I create another Tab and I want to insert it after my own tab, where can I get the control ID? 如果创建另一个选项卡并将其插入自己的选项卡之后,该怎么办?在哪里可以获取控件ID?

Thanks 谢谢

If you don't add one group after a particular tab, then all of your groups will simply fall one after another. 如果您没有在特定标签后添加一个组,那么所有组将简单地一个接一个地添加。

Since you are forcing the position of one group, then you have to reference an ISO id. 由于您要强制使用一个组的位置,因此必须引用一个ISO ID。 I don't believe you can reference your assigned Tab ID. 我不相信您可以参考您分配的标签ID。 There also a few other compile errors in your xml. xml中还有其他一些编译错误。

The solution is to simply insert your 2nd tab 1st using the isoID, and then insert your 1st group. 解决方案是简单地使用isoID在第一个选项卡中插入第二个选项卡,然后插入第一组。 Here is your xml with some syntax errors corrected: 这是您的xml,其中纠正了一些语法错误:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
   onLoad="MyOnLoad">
 <ribbon startFromScratch="false">

<tabs>

   <tab id="Tab2" label="My Second Tab" insertAfterMso="TabDatabaseTools">
      <group id="Group2" label="Example 2" supertip="Hier ist der ScreenTip">
      </group>
   </tab>

   <tab id="Tab1"  label="My Tabs"    insertAfterMso="TabDatabaseTools">
      <group id="Group1" label="Buchbeispiel Gruppe"  supertip="Hier ist der ScreenTip">
         <menu id="Menu1" label="My First Menu"  itemSize="normal">
            <button id="button1" label="Normal Button" imageMso="Risks" />
            <toggleButton id="toggleButton1" label="A toggle Button" />
            <button id="button2" label="Click me" onAction="OnButtonClick" />
         </menu>
         <menu id="menu2" label="Under menu" itemSize="large" >
            <button id="button3" label="Click the button3" 
               imageMso="FormatPainter"  onAction="OnButtonClick"/>
            <button id="button4" label="Normal Button" imageMso="Risks" />

            <menuSeparator id="sep2" title="Separator mit Text" />

            <toggleButton id="toogleButton2" imageMso="HappyFace"
               label="A toggle Button"
               description="Hiermit lassen sich Optionen auswahlen"/>
         </menu>

      </group>
   </tab>


</tabs>
</ribbon>
</customUI>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM