0

In My project, I would like to automate The following task in my work place :

  • Mails Triaging this task consist to read the email , detect the language of the email and send the email in particular folder in Outlook. lets say the Inbox have two emails one English and another in French .

the program should send the email for example to Jack EN for English emails and Julie FR For french emails.

So far I have this what I have :

Sub TriageEmails()
    Dim myolApp As Outlook.Application
    Dim aItem As Object 

    Set myolApp = CreateObject ("Outlook.Application")
    Set mail = myolApp.ActiveExplorer.CurrentFolder

    For Each AItem In mail.Items    
        `i guess the code will be here 
    Next aItem
End Sub
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
  • You will have to bring Word into it. [How can I identify the display language](https://stackoverflow.com/questions/11719754/how-can-i-identify-the-display-language-i-e-toolbars-menus-used-by-ms-office) and [Detect language of Word document](https://stackoverflow.com/questions/35390848/detect-language-of-word-document). Word reference - [Document.LanguageDetected Property](https://msdn.microsoft.com/en-us/vba/word-vba/articles/document-languagedetected-property-word) . You may be able to either update the question to narrow the focus or submit an answer. – niton Feb 28 '18 at 02:11
  • thank you for answer, I did not think the community will react soon, exporting the text into word and detecting the language, can be a good idea. i will try to work on it – Karthik Parthasarathy Mar 12 '18 at 21:02

1 Answers1

0

You can't. You might be able to detect the code page (as specified in the email headers - see MailItem.InternetCodepage property), but that tells you nothing about the language. And what do you do if there are multiple languages or code pages in the same email?

You can try to use IMultiLanguage3::DetectOutboundCodePage, but I don't think you can access IMultiLanguage in VBA.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • i have one thing in mind , the way google translator works, it can detect the language, if there is two languages ,translator will say the language which have more words in the translator box. thank you for quick response – Karthik Parthasarathy Mar 12 '18 at 21:06
  • Yes, if you have access to an API like that, I would love to access it too :-) – Dmitry Streblechenko Mar 12 '18 at 21:39