Hi,
I have successfully implemented a UserControl into MS Word ActionsPane using
VSTO 2005 (.NET 2.0). However, lately I have noticed a very strange behavior
with my UserControl.
My UserControl refuses to respond to any keyboard or mouse input. Any
ComboBox/TextBox present on my UserControl do not show any data and appear
dead.
Also any WinForm launched from the ActionsPane (my UserControl) appear to
have the same behavior and fail to show any data. I am very worried as there
is no information present regarding this issue.
Best regards,
Wamiq
wamiq@msn.com
Alvin Bruney - 12 Apr 2006 17:33 GMT
Visual studio ships with a utility that allows you to see the windows
messages that flow from the OS to the controls. For the life of me I cannot
remember what it is, but that's what you need to follow the mouse click from
the screen to your application.

Signature
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------
> Hi,
>
[quoted text clipped - 14 lines]
> Wamiq
> wamiq@msn.com
Wamiq Ansari - 18 Apr 2006 15:26 GMT
Hi Alvin,
Thanks for the reply,
I will try and look for this tool. However, this seems like a refresh issue
with Document Actions Task Pane. If I try to edit one, two or more documents
containing a UserControl in Document Actions Task Pane the UserControl seems
to Jam and appear dead. If I toggle between different Windows then the
controls on the UserControl start to corrupt. They don't seem to refresh and
don't respond to any keyboard or mouse click.
This behavior is similar to any Windows Application while crashing. 'No
Response No Refresh' if you understand what I am trying to say.
I would be highly greatfull if you could help me with this one. I have tried
to contact other MS Office MVPs (Chris, Misha) but have not received any
response.
Best regards,
Wamiq Ansari
wamiq@msn.com
> Visual studio ships with a utility that allows you to see the windows
> messages that flow from the OS to the controls. For the life of me I
[quoted text clipped - 19 lines]
>> Wamiq
>> wamiq@msn.com
Alvin Bruney - 18 Apr 2006 21:01 GMT
can you produce a short but complete program that demonstrates the issue.
I'd like to take a look. For a definition of small but workable, see this
link
http://www.yoda.arachsys.com/csharp/complete.html

Signature
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------
> Hi Alvin,
>
[quoted text clipped - 42 lines]
>>> Wamiq
>>> wamiq@msn.com
Wamiq Ansari - 28 Apr 2006 11:49 GMT
I think I have cracked it! and it seems to be working fine for now atleast.
The solution is quite simple really, so I can't believe that its fixed, but
anyways this is what I had to:
The solution was provided by the book 'Visual Studio Tools for Office' by
Eric Carter and Eric Lippert. In the method ThisDocument_StartUp() in VSTO
solution, I had to set this.Application.ScreenUpdating to 'false' to stop
Word screen from update while my code runs.
Here it is,
private void ThisDocument_Startup(object sender, System.EventArgs e)
{
//ScreenUpdate is set to false to prevent Word Screen corruption when
editing documents.
bool l_oldScreenUpdateSetting = this.Application.ScreenUpdating;
try
{
this.Application.ScreenUpdating = false;
this.ProcessMyCode();
this.Application.ScreenRefresh();
}
finally
{
this.Application.ScreenUpdating = l_oldScreenUpdateSetting;
}
}
Thanks once again for you help.
regards,
Wamiq Ansari
wamiq@msn.com
> Hi,
>
[quoted text clipped - 14 lines]
> Wamiq
> wamiq@msn.com