/// <summary> /// Show the Alfresco pane /// </summary> /// <param name="Show"></param> private void ShowAlfrescoPane() { // Try to get active document Word.Document activeDoc = null; try { activeDoc = this.Application.ActiveDocument; } catch { activeDoc = null; } // Check Word UI mode if (this.Application.ShowWindowsInTaskbar) { // Multiple window mode Microsoft.Office.Tools.CustomTaskPane customTaskPane = this.FindActiveTaskPane(); if (customTaskPane == null) { AlfrescoPane alfrescoPane = new AlfrescoPane(); alfrescoPane.WordApplication = this.Application; alfrescoPane.DefaultTemplate = "wcservice/office/"; customTaskPane = CustomTaskPanes.Add(alfrescoPane, "Alfresco"); try { if (Application.ActiveDocument != null) { alfrescoPane.OnDocumentChanged(); } else { alfrescoPane.showHome(false); } } catch { // Almost certainlty as a result of no active document alfrescoPane.showHome(false); } } customTaskPane.Visible = true; customTaskPane.Width = ALFRESCO_PANE_WIDTH; customTaskPane.VisibleChanged += new EventHandler(CustomTaskPane_VisibleChanged); } else { // Single window mode } /* if (m_CustomTaskPane == null) { m_CustomTaskPane = CustomTaskPanes.Add(m_AlfrescoPane, "Alfresco"); m_CustomTaskPane.VisibleChanged += new EventHandler(CustomTaskPane_VisibleChanged); } if (m_AlfrescoPane == null) { m_AlfrescoPane = new AlfrescoPane(); m_AlfrescoPane.WordApplication = Application; m_AlfrescoPane.DefaultTemplate = "wcservice/office/"; } if (Show) { AddCustomTaskPane(); m_CustomTaskPane.Visible = true; m_CustomTaskPane.Width = ALFRESCO_PANE_WIDTH; m_AlfrescoPane.Show(); if (Application.ActiveDocument != null) { m_AlfrescoPane.OnDocumentChanged(); } else { m_AlfrescoPane.showHome(false); } } */ }
/// <summary> /// Show the Alfresco pane /// </summary> /// <param name="Show"></param> private void ShowAlfrescoPane() { // Try to get active document Word.Document activeDoc = null; try { activeDoc = this.Application.ActiveDocument; } catch { activeDoc = null; } // Check Word UI mode if (this.Application.ShowWindowsInTaskbar) { // Multiple window mode Microsoft.Office.Tools.CustomTaskPane customTaskPane = this.FindActiveTaskPane(); if (customTaskPane == null) { AlfrescoPane alfrescoPane = new AlfrescoPane(); alfrescoPane.WordApplication = this.Application; alfrescoPane.DefaultTemplate = "wcservice/office/"; customTaskPane = CustomTaskPanes.Add(alfrescoPane, "Alfresco"); try { if (Application.ActiveDocument != null) { alfrescoPane.OnDocumentChanged(); } else { alfrescoPane.showHome(false); } } catch { // Almost certainlty as a result of no active document alfrescoPane.showHome(false); } } customTaskPane.Visible = true; customTaskPane.Width = ALFRESCO_PANE_WIDTH; customTaskPane.VisibleChanged += new EventHandler(CustomTaskPane_VisibleChanged); } else { // Single window mode } /* * if (m_CustomTaskPane == null) * { * m_CustomTaskPane = CustomTaskPanes.Add(m_AlfrescoPane, "Alfresco"); * m_CustomTaskPane.VisibleChanged += new EventHandler(CustomTaskPane_VisibleChanged); * } * * if (m_AlfrescoPane == null) * { * m_AlfrescoPane = new AlfrescoPane(); * m_AlfrescoPane.WordApplication = Application; * m_AlfrescoPane.DefaultTemplate = "wcservice/office/"; * } * * if (Show) * { * AddCustomTaskPane(); * m_CustomTaskPane.Visible = true; * m_CustomTaskPane.Width = ALFRESCO_PANE_WIDTH; * m_AlfrescoPane.Show(); * if (Application.ActiveDocument != null) * { * m_AlfrescoPane.OnDocumentChanged(); * } * else * { * m_AlfrescoPane.showHome(false); * } * } */ }