Hello Dave,
We have a problem where we get a selection changed event when a user
double clicks on a mis-spelled word in Word 2007 and we then call
get_Selection(). We get an exception that says COMException (0x800A1759)
: Cannot create a Selection object when this dialog is active.
I am not sure if I understand the steps correctly. In order to reproduce
the issue on my side, I created an Office COM add-in (C#) in VS2005. In the
Addin's OnConnection event handler, I added the line:
((Word.ApplicationClass)application).WindowSelectionChange += new
Microsoft.Office.Interop.Word.ApplicationEvents4_WindowSelectionChangeEventH
andler(Connect_WindowSelectionChange);
to register Word 2007 Selection changed event. Then in the event handler, I
printed the selected text and the exception message if any:
void Connect_WindowSelectionChange(Microsoft.Office.Interop.Word.Selection
Sel)
{
try
{
if (!string.IsNullOrEmpty(applicationObject.Selection.Text))
Debug.Print(applicationObject.Selection.Text);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
After the add-in was built and installed into Word 2007, I debugged it
inside VS2005. I double clicked some mis-spelled word in Word 2007, but
none exception message is popped up. I also tried double clicking texts in
some Field codes, and double clicking when some Office dialogs (e.g Find
dialog) is showing, unfortunately, I still cannot reproduce the error on my
side.
Would you help to check if my understanding of the steps is correct? Is
there any special Office dialog/menu showing when the error occurs on your
side? I have queried the error "Cannot create a Selection object when this
dialog is active" in our internal database, but did not find relevant issue
report. Therefore, I need more information about the problem. Would you
paste some codes or send me a small and reproducible sample so that I can
have a clearer picture of the issue?
Thanks
Jialiang Ge (
[email protected], remove 'online.')
Microsoft Online Community Support
==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document:
http://blogs.msdn.com/msdnts/pages/postingAlias.aspx
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.