Word 2003 ADXWordTaskPane

Add-in Express™ Support Service
That's what is more important than anything else

Word 2003 ADXWordTaskPane
How to display Word 2003 DXWordTaskPane 
simonmicheal smith




Posts: 1
Joined: 2009-11-03
How Do i display a Word ADXWordTaskPane

What am i doing wrong here

Thanks


namespace DatumRX
{
    /// <summary>
    ///   Add-in Express Add-in Module
    /// </summary>
    [GuidAttribute("960ECE3E-B9C3-43B2-94D4-B062E564EF75"), ProgId("DatumRX.AddinModule")]
    public class AddinModule : AddinExpress.MSO.ADXAddinModule
    {
        public AddinModule()
        {
            InitializeComponent();
            // Please add any initialization code to the AddinInitialize event handler
        }

        private AddinExpress.WD.ADXWordTaskPanesManager adxWordTaskPanesManager1;
        private AddinExpress.WD.ADXWordTaskPanesCollectionItem adxWordTaskPanesCollectionItem1;
        private AddinExpress.MSO.ADXCommandBar adxCommandBar1;
        private AddinExpress.MSO.ADXRibbonTab adxRibbonTab1;
        private AddinExpress.MSO.ADXCommandBarButton adxCommandBarButton1;
        private AddinExpress.MSO.ADXRibbonGroup adxRibbonGroup1;
        private AddinExpress.MSO.ADXRibbonButton adxRibbonButton1;
 
        #region Component Designer generated code
        /// <summary>
        /// Required by designer
        /// </summary>
        private System.ComponentModel.IContainer components;
 
        /// <summary>
        /// Required by designer support - do not modify
        /// the following method
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.adxWordTaskPanesManager1 = new AddinExpress.WD.ADXWordTaskPanesManager(this.components);
            this.adxWordTaskPanesCollectionItem1 = new AddinExpress.WD.ADXWordTaskPanesCollectionItem(this.components);
            this.adxCommandBar1 = new AddinExpress.MSO.ADXCommandBar(this.components);
            this.adxCommandBarButton1 = new AddinExpress.MSO.ADXCommandBarButton(this.components);
            this.adxRibbonTab1 = new AddinExpress.MSO.ADXRibbonTab(this.components);
            this.adxRibbonGroup1 = new AddinExpress.MSO.ADXRibbonGroup(this.components);
            this.adxRibbonButton1 = new AddinExpress.MSO.ADXRibbonButton(this.components);
            // 
            // adxWordTaskPanesManager1
            // 
            this.adxWordTaskPanesManager1.Items.Add(this.adxWordTaskPanesCollectionItem1);
            this.adxWordTaskPanesManager1.SetOwner(this);
            // 
            // adxWordTaskPanesCollectionItem1
            // 
            this.adxWordTaskPanesCollectionItem1.AlwaysShowHeader = true;
            this.adxWordTaskPanesCollectionItem1.CloseButton = true;
            this.adxWordTaskPanesCollectionItem1.TaskPaneClassName = "DatumRX.ADXWordTaskPane";
            // 
            // adxCommandBar1
            // 
            this.adxCommandBar1.CommandBarName = "adxCommandBar1";
            this.adxCommandBar1.CommandBarTag = "e9120933-711a-47af-9df3-d603f405a39f";
            this.adxCommandBar1.Controls.Add(this.adxCommandBarButton1);
            this.adxCommandBar1.UpdateCounter = 4;
            // 
            // adxCommandBarButton1
            // 
            this.adxCommandBarButton1.Caption = "Show DatumRX";
            this.adxCommandBarButton1.ControlTag = "499012ae-29dd-41dc-b18e-335dccc95e31";
            this.adxCommandBarButton1.ImageTransparentColor = System.Drawing.Color.Transparent;
            this.adxCommandBarButton1.UpdateCounter = 1;
            this.adxCommandBarButton1.Click += new AddinExpress.MSO.ADXClick_EventHandler(this.adxCommandBarButton1_Click);
            // 
            // adxRibbonTab1
            // 
            this.adxRibbonTab1.Caption = "adxRibbonTab1";
            this.adxRibbonTab1.Controls.Add(this.adxRibbonGroup1);
            this.adxRibbonTab1.Id = "adxRibbonTab_2d9c3bd23ab7405e8a2040933e8e23a0";
            this.adxRibbonTab1.Ribbons = AddinExpress.MSO.ADXRibbons.msrWordDocument;
            // 
            // adxRibbonGroup1
            // 
            this.adxRibbonGroup1.Caption = "adxRibbonGroup1";
            this.adxRibbonGroup1.Controls.Add(this.adxRibbonButton1);
            this.adxRibbonGroup1.Id = "adxRibbonGroup_e5c573adbe6a44d5bf4a718839497ec9";
            this.adxRibbonGroup1.ImageTransparentColor = System.Drawing.Color.Transparent;
            this.adxRibbonGroup1.Ribbons = AddinExpress.MSO.ADXRibbons.msrWordDocument;
            // 
            // adxRibbonButton1
            // 
            this.adxRibbonButton1.Caption = "adxRibbonButton1";
            this.adxRibbonButton1.Id = "adxRibbonButton_e74dadfb8ea84b2d820b61971ef014dc";
            this.adxRibbonButton1.ImageTransparentColor = System.Drawing.Color.Transparent;
            this.adxRibbonButton1.Ribbons = AddinExpress.MSO.ADXRibbons.msrWordDocument;
            this.adxRibbonButton1.OnClick += new AddinExpress.MSO.ADXRibbonOnAction_EventHandler(this.adxRibbonButton1_OnClick);
            // AddinModule
            // 
            this.AddinName = "DatumRX";
            this.SupportedApps = AddinExpress.MSO.ADXOfficeHostApp.ohaWord;
            this.AddinStartupComplete += new AddinExpress.MSO.ADXEvents_EventHandler(this.AddinModule_AddinStartupComplete);

        }
        #endregion
 
        #region Add-in Express automatic code
 
        // Required by Add-in Express - do not modify
        // the methods within this region
 
        public override System.ComponentModel.IContainer GetContainer()
        {
            if (components == null)
                components = new System.ComponentModel.Container();
            return components;
        }
 
        [ComRegisterFunctionAttribute]
        public static void AddinRegister(Type t)
        {
            AddinExpress.MSO.ADXAddinModule.ADXRegister(t);
        }
 
        [ComUnregisterFunctionAttribute]
        public static void AddinUnregister(Type t)
        {
            AddinExpress.MSO.ADXAddinModule.ADXUnregister(t);
        }
 
        public override void UninstallControls()
        {
            base.UninstallControls();
        }

        #endregion

        public Word._Application WordApp
        {
            get
            {
                return (HostApplication as Word._Application);
            }
        }

        private bool _showByButtonC lick = false;
        public bool ShowByButtonClick
        {
            get
            {
                return _showByButtonClick;

            }
        }

        public AddinExpress.MSO.ADXCommandBarButton CommandBarButton
        {
            get
            {
                return adxCommandBarButton1;
            }
        }


        private void ProcessButtonClick()
        {
            _showByButtonC lick = true;
            try
            {
                AddinExpress.WD.ADXWordTaskPane taskPane = adxWordTaskPanesCollectionItem1.CurrentTaskPaneInstance as DatumRX.ADXWordTaskPane;
                
                if (taskPane != null)
                {
                    taskPane.Show();
                    UpdateButton();
                }
            }
            finally
            {
                _showByButtonC lick = false;
            }
        }

        public void UpdateButton()
        {
            AddinExpress.WD.ADXWordTaskPane TaskPane = adxWordTaskPanesCollectionItem1.CurrentTaskPaneInstance as ADXWordTaskPane;

            if (Sample.WordUtils.Version == Sample.WordUtils.HostVersion.v2007)
            {
                if (TaskPane != null)
                {
                    adxRibbonButton1.Enabled = !TaskPane.Visible;
                }
                else
                {
                    adxRibbonButton1.Enabled = true;
                }
            }
            else
            {
                if (TaskPane != null)
                {
                    Sample.ADXUtils.SetEnablePropertyOfCommandBarButton(CommandBarButton, !TaskPane.Visible);
                }
                else
                {
                    Sample.ADXUtils.SetEnablePropertyOfCommandBarButton(CommandBarButton, true);
                }
            }
        }

        private void adxWordTaskPanesManager1_ADXInitialize(object sender, AddinExpress.WD.ADXInitializeEventArgs e)
        {
            Sample.WordUtils.InitVer sion(WordApp);
        }

        private void AddinModule_AddinStartupComplete(object sender, EventArgs e)
        {

            System.Windows.Forms.MessageBox.Show((adxWordTaskPanesCollectionItem1.CurrentTaskPaneInstance as DatumRX.ADXWordTaskPane).Text.ToString()); 

            UpdateButton();
        }

        private void adxCommandBarButton1_Click(object sender)
        {
            ProcessButtonClick();
        }

        private void adxRibbonButton1_OnClick(object sender, AddinExpress.MSO.IRibbonControl control, bool pressed)
        {
            ProcessButtonClick();
        }

    }
}
Posted 03 Nov, 2009 14:22:42 Top
Fedor Shihantsov


Guest


Please set the this.adxWordTaskPanesCollectionItem1.Position property and let me know about the result.
Posted 04 Nov, 2009 00:59:22 Top