views:

275

answers:

1

Hello

I'm trying to spell check and send an outlook e-mail using the following macro:

Sub SpellIt()
Dim oMail As Outlook.MailItem
Dim oDoc As Word.Document

Set oMail = Application.ActiveInspector.CurrentItem
Set oDoc = Application.ActiveInspector.WordEditor

oMail.Save    
oDoc.Content.LanguageID = wdGerman

oDoc.CheckSpelling

oMail.Save

oMail.Send
End Sub


I need to be able to set the language explicitly to German and I found it can be done using Content.LanguageID, but this does not include the subject line. How can I set the language for the subject line? Of course it would be even better to be able to set it for the whole document, but I cannot apply LanguageID to .Document

Any ideas?

Thanks, Reto

A: 

The wordeditor is used in the body of the email (in certain conditions it will be null as well). So you would not be able to work with it that way.

oMail.Subject will get you the subject text I guess you can copy that into a new document and spellcheck that then copy it back? or insert it into you wordeditor in a know range and then check and set the subject back delete the orginal range etc.

76mel
Hey... thanks for your answer. What irritates me is that oDoc.CheckSpelling is also checking the subject, so I assume that the Subject should also be somewhere in the WordEditor...
sundaymorning
will have alook at this, as i seem to remember that wordeditor object may have email headers embeded into it. can you give some more context to your question ? why are you not using outlook spell check ?
76mel