Skip to main contentdfsdf

  • Aug 06, 09

    Forklaring på hvordan man tilføjer satelit assemblies til Addin Setup projektet

  • Aug 05, 09

    Fortæller hvordan man "slukker" for button i menu, hvis man bruger x´et øverst til højre i CustomTaskPane til at lukke panen med

    • <p><strong>Refresh the status of the button</strong></p><br/><p>You also need a way to refresh the status of the button, based on the state <br/>of the custom task pane. To do that, you must call the <br/><strong>InvalidateControl</strong> method of the Office Fluent Ribbon, passing <br/>the name of the control to refresh. </p><br/><h3 class="subHeading">To add a Refresh procedure</h3><br/><div class="subSection"><br/><ul><br/><li><br/><p>In the <strong>Ribbon1</strong> class, add the following procedure, which you <br/>call when the visibility of the task pane changes.</p></li></ul></div><span id="ctl00_MTContentSelector1_mainContentContainer_ctl23"><br/><div class="libCScode" id="ctl00_MTContentSelector1_mainContentContainer_ctl23_VisualBasic"><br/><div class="CodeSnippetTitleBar"><br/><div class="CodeDisplayLanguage">Visual Basic </div><br/><div class="CopyCodeButton"><a rel="nofollow" href="http://msdn.microsoft.com/javascript:CopyCode('ctl00_MTContentSelector1_mainContentContainer_ctl23VisualBasic');" title="Copy Code" class="copyCode"><br/><div style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: auto; HEIGHT: 9px; BORDER-RIGHT-WIDTH: 0px" class="LibC_copy_off" align="center"></div>Copy Code </a></div></div><br/><div dir="ltr" style="BACKGROUND-COLOR: #ddd"><pre style="WORD-BREAK: break-all; WORD-WRAP: break-word" space="preserve" class="libCScode" id="ctl00_MTContentSelector1_mainContentContainer_ctl23VisualBasic"><span style="COLOR: blue">Public</span> <span style="COLOR: blue">Sub</span> Refresh()<br/> ribbon.InvalidateControl(<span style="COLOR: maroon">"toggleButton1"</span>)<br/><span style="COLOR: blue">End</span> <span style="COLOR: blue">Sub</span></pre></div></div></span><span id="ctl00_MTContentSelector1_mainContentContainer_ctl24"><br/><div style="DISPLAY: none" class="libCScode" id="ctl00_MTContentSelector1_mainContentContainer_ctl24_CSharp"><br/><div class="CodeSnippetTitleBar"><br/><div class="CodeDisplayLanguage">C# </div><br/><div class="CopyCodeButton"><a rel="nofollow" href="http://msdn.microsoft.com/javascript:CopyCode('ctl00_MTContentSelector1_mainContentContainer_ctl24CSharp');" title="Copy Code" class="copyCode"><br/><div style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: auto; HEIGHT: 9px; BORDER-RIGHT-WIDTH: 0px" class="LibC_copy_off" align="center"></div>Copy Code </a></div></div><br/><div dir="ltr" style="BACKGROUND-COLOR: #ddd"><pre style="WORD-BREAK: break-all; WORD-WRAP: break-word" space="preserve" class="libCScode" id="ctl00_MTContentSelector1_mainContentContainer_ctl24CSharp"><span style="COLOR: blue">public</span> <span style="COLOR: blue">void</span> Refresh()<br/>{<br/> ribbon.InvalidateControl(<span style="COLOR: maroon"><span style="COLOR: maroon">"toggleButton1"</span></span>);<br/>}</pre></div></div></span><br/><p><strong>Display the toggle button</strong></p><br/><p>You want to determine whether the toggle button should appear pressed or not, <br/>based on the visibility of the task pane. The <strong>ToggleButton</strong> <br/>control provides an attribute, <strong>getPressed</strong>, that allows you to <br/>specify the name of a procedure it will call, as the Office Fluent Ribbon <br/>refreshes its display, to determine whether it should appear pressed. </p><br/><h3 class="subHeading">To add a GetPressed procedure</h3><br/><div class="subSection"><br/><ul><br/><li><br/><p>Add the following procedure to the <strong>Ribbon1</strong> <br/>class.</p></li></ul></div><span id="ctl00_MTContentSelector1_mainContentContainer_ctl25"><br/><div class="libCScode" id="ctl00_MTContentSelector1_mainContentContainer_ctl25_VisualBasic"><br/><div class="CodeSnippetTitleBar"><br/><div class="CodeDisplayLanguage">Visual Basic </div><br/><div class="CopyCodeButton"><a rel="nofollow" href="http://msdn.microsoft.com/javascript:CopyCode('ctl00_MTContentSelector1_mainContentContainer_ctl25VisualBasic');" title="Copy Code" class="copyCode"><br/><div style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: auto; HEIGHT: 9px; BORDER-RIGHT-WIDTH: 0px" class="LibC_copy_off" align="center"></div>Copy Code </a></div></div><br/><div dir="ltr" style="BACKGROUND-COLOR: #ddd"><pre style="WORD-BREAK: break-all; WORD-WRAP: break-word" space="preserve" class="libCScode" id="ctl00_MTContentSelector1_mainContentContainer_ctl25VisualBasic"><span style="COLOR: blue">Public</span> <span style="COLOR: blue">Function</span> GetPressed( _<br/> <span style="COLOR: blue">ByVal</span> control <span style="COLOR: blue">As</span> Office.IRibbonControl) <span style="COLOR: blue">As</span> <span style="COLOR: blue">Boolean</span><br/> <span style="COLOR: blue">Return</span> Globals.ThisAddIn.ctp.Visible<br/><span style="COLOR: blue">End</span> <span style="COLOR: blue">Function</span></pre></div></div></span><span id="ctl00_MTContentSelector1_mainContentContainer_ctl26"><br/><div style="DISPLAY: none" class="libCScode" id="ctl00_MTContentSelector1_mainContentContainer_ctl26_CSharp"><br/><div class="CodeSnippetTitleBar"><br/><div class="CodeDisplayLanguage">C# </div><br/><div class="CopyCodeButton"><a rel="nofollow" href="http://msdn.microsoft.com/javascript:CopyCode('ctl00_MTContentSelector1_mainContentContainer_ctl26CSharp');" title="Copy Code" class="copyCode"><br/><div style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: auto; HEIGHT: 9px; BORDER-RIGHT-WIDTH: 0px" class="LibC_copy_off" align="center"></div>Copy Code </a></div></div><br/><div dir="ltr" style="BACKGROUND-COLOR: #ddd"><pre style="WORD-BREAK: break-all; WORD-WRAP: break-word" space="preserve" class="libCScode" id="ctl00_MTContentSelector1_mainContentContainer_ctl26CSharp"><span style="COLOR: blue">public</span> <span style="COLOR: blue">bool</span> GetPressed(Office.IRibbonControl control)<br/>{<br/> <span style="COLOR: blue">return</span> Globals.ThisAddIn.ctp.Visible;<br/>}</pre></div></div></span><br/><h3 class="subHeading">To modify Ribbon1.xml</h3><br/><div class="subSection"><br/><ul><br/><li><br/><p>From the <strong>Solution Explorer</strong> window, re-open the <br/><strong>Ribbon1.xml</strong> file. Modify the XML, adding the <br/><strong>getPressed</strong> attribute.</p></li></ul></div><span id="ctl00_MTContentSelector1_mainContentContainer_ctl27"><br/><div class="libCScode" id="ctl00_MTContentSelector1_mainContentContainer_ctl27_xml"><br/><div class="CodeSnippetTitleBar"><br/><div class="CodeDisplayLanguage">Xml </div><br/><div class="CopyCodeButton"><a rel="nofollow" href="http://msdn.microsoft.com/javascript:CopyCode('ctl00_MTContentSelector1_mainContentContainer_ctl27xml');" title="Copy Code" class="copyCode"><br/><div style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: auto; HEIGHT: 9px; BORDER-RIGHT-WIDTH: 0px" class="LibC_copy_off" align="center"></div>Copy Code </a></div></div><br/><div dir="ltr" style="BACKGROUND-COLOR: #ddd"><pre style="WORD-BREAK: break-all; WORD-WRAP: break-word" space="preserve" class="libCScode" id="ctl00_MTContentSelector1_mainContentContainer_ctl27xml"><span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">customUI</span> xmlns="http://schemas.microsoft.com/office/2006/01/customui" <br/> onLoad="OnLoad"<span style="COLOR: blue">&gt;</span><br/> <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">ribbon</span><span style="COLOR: blue">&gt;</span><br/> <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">tabs</span><span style="COLOR: blue">&gt;</span><br/> <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">tab</span> idMso="TabAddIns"<span style="COLOR: blue">&gt;</span><br/> <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">group</span> id="MyGroup"<br/> label="My Group"<span style="COLOR: blue">&gt;</span><br/> <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">toggleButton</span> id="toggleButton1" <br/> size="large"<br/> label="Date Task Pane"<br/> screentip="Display the date task pane"<br/> onAction="OnToggleButton1" <br/> getPressed="GetPressed" <br/> imageMso="DateAndTimeInsert" <span style="COLOR: blue">/&gt;</span><br/> <span style="COLOR: blue">&lt;/</span><span style="COLOR: maroon">group</span><span style="COLOR: blue">&gt;</span><br/> <span style="COLOR: blue">&lt;/</span><span style="COLOR: maroon">tab</span><span style="COLOR: blue">&gt;</span><br/> <span style="COLOR: blue">&lt;/</span><span style="COLOR: maroon">tabs</span><span style="COLOR: blue">&gt;</span><br/> <span style="COLOR: blue">&lt;/</span><span style="COLOR: maroon">ribbon</span><span style="COLOR: blue">&gt;</span><br/><span style="COLOR: blue">&lt;/</span><span style="COLOR: maroon">customUI</span><span style="COLOR: blue">&gt;</span></pre></div></div></span><br/><h3 class="subHeading">To add a Refresh procedure</h3><br/><div class="subSection"><br/><ul><br/><li><br/><p>The custom task pane should refresh the Office Fluent Ribbon when it changes <br/>its visibility. The <strong>CustomTaskPane</strong> class raises the <br/><strong>VisibleChanged</strong> event for this purpose. In the <br/><strong>ThisAddIn</strong> class, add the following <br/>procedure.</p></li></ul></div><span id="ctl00_MTContentSelector1_mainContentContainer_ctl28"><br/><div class="libCScode" id="ctl00_MTContentSelector1_mainContentContainer_ctl28_VisualBasic"><br/><div class="CodeSnippetTitleBar"><br/><div class="CodeDisplayLanguage">Visual Basic </div><br/><div class="CopyCodeButton"><a rel="nofollow" href="http://msdn.microsoft.com/javascript:CopyCode('ctl00_MTContentSelector1_mainContentContainer_ctl28VisualBasic');" title="Copy Code" class="copyCode"><br/><div style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: auto; HEIGHT: 9px; BORDER-RIGHT-WIDTH: 0px" class="LibC_copy_off" align="center"></div>Copy Code </a></div></div><br/><div dir="ltr" style="BACKGROUND-COLOR: #ddd"><pre style="WORD-BREAK: break-all; WORD-WRAP: break-word" space="preserve" class="libCScode" id="ctl00_MTContentSelector1_mainContentContainer_ctl28VisualBasic"><span style="COLOR: blue">Private</span> <span style="COLOR: blue">Sub</span> HandleVisibleChanged( _<br/> <span style="COLOR: blue">ByVal</span> sender <span style="COLOR: blue">As</span> <span style="COLOR: blue">Object</span>, <span style="COLOR: blue">ByVal</span> e <span style="COLOR: blue">As</span> EventArgs)<br/> ribbon.Refresh()<br/><span style="COLOR: blue">End</span> <span style="COLOR: blue">Sub</span></pre></div></div></span><span id="ctl00_MTContentSelector1_mainContentContainer_ctl29"><br/><div style="DISPLAY: none" class="libCScode" id="ctl00_MTContentSelector1_mainContentContainer_ctl29_CSharp"><br/><div class="CodeSnippetTitleBar"><br/><div class="CodeDisplayLanguage">C# </div><br/><div class="CopyCodeButton"><a rel="nofollow" href="http://msdn.microsoft.com/javascript:CopyCode('ctl00_MTContentSelector1_mainContentContainer_ctl29CSharp');" title="Copy Code" class="copyCode"><br/><div style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: auto; HEIGHT: 9px; BORDER-RIGHT-WIDTH: 0px" class="LibC_copy_off" align="center"></div>Copy Code </a></div></div><br/><div dir="ltr" style="BACKGROUND-COLOR: #ddd"><pre style="WORD-BREAK: break-all; WORD-WRAP: break-word" space="preserve" class="libCScode" id="ctl00_MTContentSelector1_mainContentContainer_ctl29CSharp"><span style="COLOR: blue">private</span> <span style="COLOR: blue">void</span> HandleVisibleChanged(Object sender, EventArgs e)<br/>{<br/> ribbon.Refresh();<br/>}</pre></div></div></span><br/><h3 class="subHeading">To hook up the event handler</h3><br/><div class="subSection"><br/><ul><br/><li><br/><p>To hook up the event handler, add the following code to the end of the <br/>existing <strong>ThisAddIn_Startup</strong> procedure.</p></li></ul></div><span id="ctl00_MTContentSelector1_mainContentContainer_ctl30"><br/><div class="libCScode" id="ctl00_MTContentSelector1_mainContentContainer_ctl30_VisualBasic"><br/><div class="CodeSnippetTitleBar"><br/><div class="CodeDisplayLanguage">Visual Basic </div><br/><div class="CopyCodeButton"><a rel="nofollow" href="http://msdn.microsoft.com/javascript:CopyCode('ctl00_MTContentSelector1_mainContentContainer_ctl30VisualBasic');" title="Copy Code" class="copyCode"><br/><div style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: auto; HEIGHT: 9px; BORDER-RIGHT-WIDTH: 0px" class="LibC_copy_off" align="center"></div>Copy Code </a></div></div><br/><div dir="ltr" style="BACKGROUND-COLOR: #ddd"><pre style="WORD-BREAK: break-all; WORD-WRAP: break-word" space="preserve" class="libCScode" id="ctl00_MTContentSelector1_mainContentContainer_ctl30VisualBasic"><span style="COLOR: blue">AddHandler</span> ctp.VisibleChanged, <span style="COLOR: blue">AddressOf</span> HandleVisibleChanged</pre></div></div></span><span id="ctl00_MTContentSelector1_mainContentContainer_ctl31"><br/><div style="DISPLAY: none" class="libCScode" id="ctl00_MTContentSelector1_mainContentContainer_ctl31_CSharp"><br/><div class="CodeSnippetTitleBar"><br/><div class="CodeDisplayLanguage">C# </div><br/><div class="CopyCodeButton"><a rel="nofollow" href="http://msdn.microsoft.com/javascript:CopyCode('ctl00_MTContentSelector1_mainContentContainer_ctl31CSharp');" title="Copy Code" class="copyCode"><br/><div style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: auto; HEIGHT: 9px; BORDER-RIGHT-WIDTH: 0px" class="LibC_copy_off" align="center"></div>Copy Code </a></div></div><br/><div dir="ltr" style="BACKGROUND-COLOR: #ddd"><pre style="WORD-BREAK: break-all; WORD-WRAP: break-word" space="preserve" class="libCScode" id="ctl00_MTContentSelector1_mainContentContainer_ctl31CSharp">ctp.VisibleChanged += HandleVisibleChanged;</pre></div></div></span><br/><h3 class="subHeading">To unhook the event handler</h3><br/><div class="subSection"><br/><ul><br/><li><br/><p>To unhook the event handler, add the following code to the existing <br/><strong>ThisAddIn_Shutdown</strong> procedure.</p></li></ul></div>
    • The following instructions describe how to add the packages listed above to the  bootstrapper package directory. These changes need be made only once and only on  your development computer
1 - 5 of 5
20 items/page
List Comments (0)