0

VSTO で ContextMenuListRange を作成したいのですが、ContextMenuCell 用にもう 1 つの xml を既に作成しています。リスト範囲をもう 1 つのタグに追加すると、リボンに「オブジェクト参照がオブジェクトのインスタンスに設定されていません。ここに xml タグがあります。

<contextMenus>
<contextMenu idMso="ContextMenuCell">
  <menu id="MySubMenu" label="Visualization">
    <button id="contextBtn2" getEnabled="GetEnabled" getLabel="GetLabel" image="2Image" onAction="Part2Vis_Click"/>
    <button id="contextBtn3" getEnabled="GetEnabled" getLabel="GetLabel" image="3Image" onAction="Part3Vis_Click"/>
    <button id="contextBtn3Mod" getEnabled="GetEnabled" getLabel="GetLabel" image="3Module" onAction="Module3Vis_Click"/>
    <button id="contextBtnAdv" getLabel="GetLabel" onAction="BtnAdvClick" image="advImage"/>
    <button id="contextBtnOption" getLabel="GetLabel" onAction="BtnOptionClick" image="Settings"/>
    <button id="contextBtnHelpPage" getLabel="GetLabel" onAction="BtnHelpPageClick"  image="Help"/>
  </menu>     
</contextMenu>
</contextMenus> 
<contextMenus>
<contextMenu idMso="ContextMenuListRange">
  <menu id="MyContextNew" label="Visualization">
    <button id="contextBtn2d" getEnabled="GetEnabled" getLabel="GetLabel" image="2dImage" onAction="Part2DVis_Click"/>
    <button id="contextBtn3d" getEnabled="GetEnabled" getLabel="GetLabel" image="3dImage" onAction="Part3DVis_Click"/>
    <button id="contextBtn3dMod" getEnabled="GetEnabled" getLabel="GetLabel" image="3DModule" onAction="Module3DVis_Click"/>
    <button id="contextBtnAdv" getLabel="GetLabel" onAction="BtnAdvClick" image="advImage"/>
    <button id="contextBtnOption" getLabel="GetLabel" onAction="BtnOptionClick" image="Settings"/>
    <button id="contextBtnHelpPage" getLabel="GetLabel" onAction="BtnHelpPageClick"  image="Help"/>
  </menu>     
</contextMenu>

4

2 に答える 2

0

contextMenus 内にすべてを囲む

<contextMenus>
<contextMenu idMso="ContextMenuCell">
  <menu id="MySubMenu" label="Visualization">
    <button id="contextBtn2" getEnabled="GetEnabled" getLabel="GetLabel" image="2Image" onAction="Part2Vis_Click"/>
    <button id="contextBtn3" getEnabled="GetEnabled" getLabel="GetLabel" image="3Image" onAction="Part3Vis_Click"/>
    <button id="contextBtn3Mod" getEnabled="GetEnabled" getLabel="GetLabel" image="3Module" onAction="Module3Vis_Click"/>
    <button id="contextBtnAdv" getLabel="GetLabel" onAction="BtnAdvClick" image="advImage"/>
    <button id="contextBtnOption" getLabel="GetLabel" onAction="BtnOptionClick" image="Settings"/>
    <button id="contextBtnHelpPage" getLabel="GetLabel" onAction="BtnHelpPageClick"  image="Help"/>
  </menu>     
</contextMenu>

<contextMenu idMso="ContextMenuListRange">
  <menu id="MyContextNew" label="Visualization">
    <button id="contextBtn2d" getEnabled="GetEnabled" getLabel="GetLabel" image="2dImage" onAction="Part2DVis_Click"/>
    <button id="contextBtn3d" getEnabled="GetEnabled" getLabel="GetLabel" image="3dImage" onAction="Part3DVis_Click"/>
    <button id="contextBtn3dMod" getEnabled="GetEnabled" getLabel="GetLabel" image="3DModule" onAction="Module3DVis_Click"/>
    <button id="contextBtnAdv" getLabel="GetLabel" onAction="BtnAdvClick" image="advImage"/>
    <button id="contextBtnOption" getLabel="GetLabel" onAction="BtnOptionClick" image="Settings"/>
    <button id="contextBtnHelpPage" getLabel="GetLabel" onAction="BtnHelpPageClick"  image="Help"/>
  </menu>     
</contextMenu>

</contextMenus> 
于 2014-09-23T06:22:46.737 に答える