From bf15d264ba5c37ed1476943bc6c8302d7d621124 Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Sun, 6 Sep 2015 11:40:00 +0200 Subject: [PATCH] Activate zaaReloaded tab after loading demo document. --- zaaReloaded2/Demo/Demo.cs | 5 +---- zaaReloaded2/Ribbon.cs | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/zaaReloaded2/Demo/Demo.cs b/zaaReloaded2/Demo/Demo.cs index 54e9478..fa7abf9 100755 --- a/zaaReloaded2/Demo/Demo.cs +++ b/zaaReloaded2/Demo/Demo.cs @@ -15,11 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; using Microsoft.Office.Interop.Word; namespace zaaReloaded2.Demo @@ -43,6 +39,7 @@ namespace zaaReloaded2.Demo Document demoDoc = Globals.ThisAddIn.Application.Documents .Add(Template: tempFile); File.Delete(tempFile); + Globals.ThisAddIn.Ribbon.ActivateZaaTab(); } #endregion diff --git a/zaaReloaded2/Ribbon.cs b/zaaReloaded2/Ribbon.cs index cf6abbd..d098166 100755 --- a/zaaReloaded2/Ribbon.cs +++ b/zaaReloaded2/Ribbon.cs @@ -152,16 +152,24 @@ namespace zaaReloaded2 #endregion - #region Private methods + #region Public methods - public void Application_WindowSelectionChange(Microsoft.Office.Interop.Word.Selection Sel) + /// + /// Activates the add-in's tab. + /// + public void ActivateZaaTab() { - _ribbon.Invalidate(); + _ribbon.ActivateTab("zaaReloaded2"); } #endregion - #region Helpers + #region Private methods + + private void Application_WindowSelectionChange(Microsoft.Office.Interop.Word.Selection Sel) + { + _ribbon.Invalidate(); + } private static string GetResourceText(string resourceName) {