Activate zaaReloaded tab after loading demo document.

This commit is contained in:
Daniel Kraus 2015-09-06 11:40:00 +02:00
parent 687a5cce20
commit bf15d264ba
2 changed files with 13 additions and 8 deletions

View File

@ -15,11 +15,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text;
using Microsoft.Office.Interop.Word; using Microsoft.Office.Interop.Word;
namespace zaaReloaded2.Demo namespace zaaReloaded2.Demo
@ -43,6 +39,7 @@ namespace zaaReloaded2.Demo
Document demoDoc = Globals.ThisAddIn.Application.Documents Document demoDoc = Globals.ThisAddIn.Application.Documents
.Add(Template: tempFile); .Add(Template: tempFile);
File.Delete(tempFile); File.Delete(tempFile);
Globals.ThisAddIn.Ribbon.ActivateZaaTab();
} }
#endregion #endregion

View File

@ -152,16 +152,24 @@ namespace zaaReloaded2
#endregion #endregion
#region Private methods #region Public methods
public void Application_WindowSelectionChange(Microsoft.Office.Interop.Word.Selection Sel) /// <summary>
/// Activates the add-in's tab.
/// </summary>
public void ActivateZaaTab()
{ {
_ribbon.Invalidate(); _ribbon.ActivateTab("zaaReloaded2");
} }
#endregion #endregion
#region Helpers #region Private methods
private void Application_WindowSelectionChange(Microsoft.Office.Interop.Word.Selection Sel)
{
_ribbon.Invalidate();
}
private static string GetResourceText(string resourceName) private static string GetResourceText(string resourceName)
{ {