Ken,
What about checking the count of errors after performing the spell check?
If the count = 0, then assume that the spell check completed. If the count
0 then assume that the user canceled the spell check? Something like
this:
Dim objDoc As Word.Document
objDoc = inspector.WordEditor
objDoc.CheckSpelling()
If objDoc.SpellingErrors.Count 0 Then
If MsgBox("There are still spelling errors, do you
wish to send the message anyway?", MsgBoxStyle.YesNo, "Custom Send Routine")
= MsgBoxResult.Yes Then
'send the message
End If
Else
'send the message
End If
Thoughts/comments on this approach?
-Brian
"Ken Slovak - [MVP - Outlook]" wrote in message
...
As far as I know there's no way to get that from the dialog without doing
hacks using Win32 API calls and subclassing the dialog to intercept mouse
clicks and keyboard presses directed to the dialog. You'd have to see if
those are directed at the location of the Cancel button and if so take
your prompt action then.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"Brian McCullough" wrote in message
...
Ken/All,
This seems to work just fine for me and I am using VB.NET 1.1.
Here is my code:
If outlookVersion = OUTLOOK_2007_VERSION Then
Dim objDoc As Word.Document
objDoc = inspector.WordEditor
objDoc.CheckSpelling()
Else
'do spell checking the old way (i.e. for Outlook 2003
and 2002)
End If
I guess there is no way to determine if the user hits the "Cancel" button
and cancels the spell check? I'd like to be able to determine this to
know if I should send the message or not. If the user cancels the spell
check, I'd like to prompt them to see if they want to send the message
anyway, just like Outlook does when you use the regular "Send" button.
Thanks!!
Brian