Running spell checker programmatically

J

Jenny Tam

Hi

I've written an Outlook COM add-in and one of its goals is to add our
custom 'Send' button in Inspector windows for new mails. I've used
Extended MAPI to do the sending part and so far so good.
Unfortunately, I can't seem to find a way to invoke the spell checker
programmatically in Outlook before sending new mails. Is it even
possible?

Also, when it comes to WordMail in OL2002 SP3, I can't seem to avoid
the security warnings because of the Inspector.WordEditor. Does
anybody have any clues?

Thanks in advance!!
Jenny
 
K

Ken Slovak - [MVP - Outlook]

WordEditor is restricted in Outlook 2003, Outlook 2002 SP3 and will be in
Outlook 2000 SP4 when it eventually comes out. You'd have to use Extended
MAPI or the new version of Redemption when it comes out in a few weeks to
avoid the restrictions on WordEditor.

Running the spell checker isn't exposed to the Outlook object model. If
WordMail is used you can use the Word object model for that document to run
the spell checker but not otherwise.
 
J

Jenny Tam

Thanks for the detailed reply. I've been using Extended MAPI all
along to extract email properties. Unfortunately, I need to get the
Inspector.WordEditor object so that I can access the CommandBars
collection, etc. I don't know how it can be done by Extended MAPI at
all. Any clues?

It's great to know that it's possible to run spell checker
programmatically provided that WordMail is used. However, I don't
want to do that unless the user has specified to check spelling before
sending ... Is it possible to know whether the user has specified that
or not then?

Thanks for your help!
Jenny
 
K

Ken Slovak - [MVP - Outlook]

It's certainly possible to get what you want using Extended MAPI, that's how
Dmitry does it for Redemption and for OutlookSpy. If you have OutlookSpy use
it to examine the properties of the Inspector object in an open item to get
the GUID for the Inspector and the DispID's for the properties you want to
work with.

For Outlook 2003
HKCU\Software\Microsoft\Office\11.0\Outlook\Options\Spelling\Check is a
DWORD where 1 = check before sending. Adjust the registry path for the
Outlook version. You'll also find other interesting values in the Spelling
key and in \Options\Mail you'll find other values that might be of interest
to you.
 
J

Jenny Tam

Thanks again for the prompt reply! You've been extremely helpful!

I do have OutlookSpy running, and it's very useful to me so far.
Unfortunately I get access violations (for some buttons only) for
unknown reasons. Based on your suggestions below, I open a MailItem
in an Outlook Inspector and clicked the 'Inspector' button. However,
I got this error

"Access violation at address 65FF5C04 in module 'foldprot.dll'. Read
of address FFFFFFFF" [OK]

In fact, when I clicked the 'CurrentItem' button, I got dozens of
error message boxes too ... :-( and Outlook hangs ...

I'm not sure if I need to set up something before using OutlookSpy.
Otherwise, clicking Extended MAPI related buttons work very well!

Thanks,
Jenny
 
K

Ken Slovak - [MVP - Outlook]

Those problems you'd have to take up with Dmitry (the author of OutlookSpy).
All I can say is I use it here on Outlook 2000, Outlook 2002 and 4
installations of Outlook 2003 with none of the errors you've mentioned.
Sorry, I can't help with that one.

For open items I just usually use IMessage.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top