Known issues with Microsoft Office automation.

From AutoIt Wiki
Jump to navigation Jump to search

AutoIt provides a powerful integration and manipulation tool for the MS Windows environment and the WinAPI. Some features of Microsoft's Windows and Office products are proprietary and cannot readily be manipulated. Sometimes workarounds are required. It should be noted that some of these issues change over different versions, resulting in "unexplained" errors or unexpected behavior. This pages is dedicated to identifying those issues, provide explanations and list solutions or workarounds.

Also, please note that since MS Office products function within the Windows environment, the behavior of different components may be mutually interdependent. Simply changing one setting in a specific box, may not have same or desired effect across all platforms and all versions. The uniform use of Windows 10 should reduce these issues.

Microsoft Outlook Email WINMAIL.DAT

The Problem

Microsoft mail products such as Outlook, Office 365 and Exchange may send mail messages in a proprietary format known as TNEF that only other Microsoft products accept. Find out how to configure your Microsoft product in the list below so it doesn’t send messages in the TNEF format. From Capsule CRM

Email sent using Outlook may be formatted using the Microsoft proprietary TNEF format. Sending the mail appears correct, but the recipient typically receives an email attachment in winmail.dat format. A quick search will indicate just how wide spread this problem is.

The Cause

Transport Neutral Encapsulation Format or TNEF is a proprietary email attachment format used by Microsoft Outlook and Microsoft Exchange Server. An attached file with TNEF encoding is most often named winmail.dat or win.dat, and has a MIME type of Application/MS-TNEF. The official (IANA) media type, however, is application/ Fronm this page: Transport Neutral Encapsulation Format

Look out for

Microsoft uses "aliases" for the TNEF model. These include "Sending in Rich Text Format". The mail is not sent in RTF but rather forces TNEF encoding. Sending in Plain or HTML format appears to prefer non-TNEF, but sometimes fails.


Microsoft does not provide a single "Do not use TNEF" configuration item. Settings are dispersed over several interfaces.

The preferred solution appears to prevent MS Outlook from sending TNEF encoded messages. There is no control over the decoding of the message as received. By preventing the senders use of TNEF, this problem may be mitigated.

Search DisableTNEF for alternatives.

Windows Registry

I added a DWORD named "DisableTNEF" to the key HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Preferences. I set the value at 1. From Microsoft Answers

NOTE: Using the reg command line tool /f switch it is possible to silently add a non-existing value.

C:\AutoIt>reg add HKEY_CURRENT_USER\Software\Microsoft\Office\7.0\Outlook\Preferences /v DisableTNEF /t REG_DWORD /d 1 /f

The operation completed successfully.

In Outlook 2016

If you send emails via Office 365 when using Outlook 2016, refer to the Office 365 configuration.

Alternatively if you send messages from Outlook 2016 via a different mail server or want a solution that avoids configuration of Office 365, follow these steps to turn off TNEF:

  • Click the File tab, click Options, and then click on Mail.
  • In the Compose in this message format list, click Plain Text or HTML, and then click OK.

Also clear any preferences associated with Outlook’s auto complete list.

  • Go to File Options Mail Send Messages section.
  • Click Empty Auto-Complete List.

In Outlook 2013 & 2010

To turn off TNEF, follow these steps:

  • Click the File tab, click Options, and then click Mail.
  • In the Compose in this message format list, click Plain Text or HTML, and then click OK.

In Outlook 2007

To turn off TNEF, follow these steps:

  • On the Tools menu, click Options and then click the Mail Format tab.
  • In the Compose in this message format list, click Plain Text or HTML, and then click OK.