Search code examples
windowsemailuser-interfaceoutlookemail-attachments

GUI elements shifted with MS Outlook 11.0 Object Library + Outlook 2016 Ver 1702


I've an proprietary software with own IDE and windows client. In the IDE I use the Microsoft Outlook 11.0 Object Library to send attachments per Mail. But since Outlook 2016 Version 1702 the GUI elements To, Cc and subject are shifted. The Sendbutton is also not reachable. In Version 1609 I didn't have the problem. Does anybody know this problem and how to fix it? Is there maybe a newer version of the library? Or is there a setting in Outlook which solves the problem? Thanks in advance.

new mail with shifted to, Cc and subject


Solution

  • I also encountered this issue and can confirm it has started occurring as of Office 2016 update 1701. It does not appear to be related to the object library as I am using the 16.0 object library, not 11.0.

    I managed to narrow down the GUI issue (as depicted in the image you posted) to file attachments.

    To address this issue, display the mail window first and then attach any files. Here is an example of the approach I took:

    Dim olApp As New Outlook.Application
    Dim exampleMail As Outlook.MailItem
    Dim exampleFiles As Outlook.Attachments
    
    Set exampleMail = olApp.CreateItem(olMailItem)
    Set exampleFiles = exampleMail.Attachments
    
    With exampleMail
        .To = "example@email.com"
        .Subject = "Example Subject"
        .BodyFormat = olFormatHTML
        .HTMLBody = "Hello, This is an example."
        .Display
    End With
    
    Filename = "C:\SomeFolder\someFile.xlsx"
    exampleFiles.Add Filename
    

    If you are choosing to late-bind:

    Dim olApp As Object   
    Dim exampleMail As Object
    Dim exampleFiles As Object
    
    Set olApp = CreateObject("Outlook.Application")
    Set exampleMail = olApp.CreateItem(0)
    Set exampleFiles = exampleMail.Attachments