none
Word status bar blank or frozen RRS feed

  • Question

  • I'm using Add-in Express, but I've also managed to recreate this issue using VSTO.  The issue I have is that the Word status bar is either blank or frozen and won't update.

    I narrowed this down to the use of a Telerik WPF GridView control that I'm hosting in a Custom Task Pane.  This control has a System.Windows.Timer that ticks ever 100ms, and on tick it raises and property changes on the UI thread using Dispatcher.BeginInvoke.  However, this can be replicated pretty simply without any WPF.  Simply create a new UserControl that has the following in the code behind:
    public partial class UserControlWithTimer : UserControl 
    { 
        private System.Timers.Timer _timer; 
     
        public UserControlWithTimer() 
        { 
            InitializeComponent();                         
        } 
     
        protected override void OnLoad(EventArgs e) 
        { 
            base.OnLoad(e); 
     
            if (_timer == null) 
            { 
                _timer = new System.Timers.Timer(); 
                _timer.Interval = 100; 
                _timer.Elapsed += OnTick; 
                _timer.Start(); 
            } 
        } 
             
        private void OnTick(object sender, ElapsedEventArgs e) 
        { 
            Action action = () => { }; 
            BeginInvoke(action); 
        } 
    } 

    Add this user control to a Custom Task Pane and start up Word.  The Status Bar will be blank.  I found empirically that if I increased the Interval to 300ms then I got the Word Count back and if I increased to 400ms then the Page Count returned as well.

    I was hoping to understand the issue and see if I can work around it.  It seems as if the internals for rendering this bit are on a timeout, and the invocation from managed code onto the UI thread seems to reset it.

    Obviously if this was my own code, I could increase the Interval or remove the Timer entirely, but as they're built into 3rd Party Controls I'm a bit stuck!

    Friday, October 2, 2015 2:26 PM

Answers

  • Hi,

    As far as I know, there are sever types of time in .Net developing. If you want to use Timer in Windows form developing, please use System.Windows.Forms.Timer instead of others.

    As far as I test, this timer works well for me. Hope it is helpful. You can get more detail about these two times from link below:
    System.Windows.Forms.Timer

    System.Timers.Timer

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 5, 2015 3:32 AM
    Moderator
  • Hi csmager,  

    The System.Timers.Timer component is a server-based timer that raises an Elapsed event in your application after the number of milliseconds in the Interval property has elapsed. You can get more detail about this timer from link below:
    Timer Class

    Since the you were using third-party library, I suggest that contact the official support from the third-party company.

    If this issue is urgent, you can also try to contact Microsoft support to raise an incident so that our engineer could work closely with him to identify the root cause and resolve this issue as soon as possible.

    If the support engineer determines that the issue is the result of a bug the service request will be a no-charge case and you won't be charged.

    Please visit the below link to see the various paid support options that are available to better meet your needs. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, October 6, 2015 6:12 AM
    Moderator

All replies

  • Hi,

    As far as I know, there are sever types of time in .Net developing. If you want to use Timer in Windows form developing, please use System.Windows.Forms.Timer instead of others.

    As far as I test, this timer works well for me. Hope it is helpful. You can get more detail about these two times from link below:
    System.Windows.Forms.Timer

    System.Timers.Timer

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 5, 2015 3:32 AM
    Moderator
  • Hi Fei

    Thanks for the reply.  Unfortunately I have no control over this - the code I showed was enough to replicate the problem, but the problem itself is caused by a 3rd party WPF control that uses a System.Timers.Timer in a similar fashion.

    I've managed to workaround the problem by disabling this functionality, but I'm concerned that this is likely to be a common regression in future releases of our add-in.  I was hoping to understand the issue better.

    Monday, October 5, 2015 9:28 AM
  • Hi csmager,  

    The System.Timers.Timer component is a server-based timer that raises an Elapsed event in your application after the number of milliseconds in the Interval property has elapsed. You can get more detail about this timer from link below:
    Timer Class

    Since the you were using third-party library, I suggest that contact the official support from the third-party company.

    If this issue is urgent, you can also try to contact Microsoft support to raise an incident so that our engineer could work closely with him to identify the root cause and resolve this issue as soon as possible.

    If the support engineer determines that the issue is the result of a bug the service request will be a no-charge case and you won't be charged.

    Please visit the below link to see the various paid support options that are available to better meet your needs. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, October 6, 2015 6:12 AM
    Moderator