MailItem .Save() slow

Add-in Express™ Support Service
That's what is more important than anything else

MailItem .Save() slow
 
Yacin H




Posts: 1
Joined: 2023-09-04
Hello,

On a specific environment (Microsoft Windows Server 2022 Standard, Version: 10.0.20348.0 / Outlook version 16.0.16130.20714 / Online mode), after clicking on Send, the COM add-in needs to read the PR_SEARCH_KEY.
The email being sent has a 27mb .csv file attached.

My code looks like this


Public Shared Function MyFunction(mailItem As Object)
        Dim pa As Microsoft.Office.Interop.Outlook.PropertyAccessor = Nothing
        Dim oomMail = TryCast(mailItem, Microsoft.Office.Interop.Outlook.MailItem)

        Try
            oomMail.Save()

            pa = oomMail.PropertyAccessor
            Dim binProperty = pa.GetProperty(Consts.PR_SEARCH_KEY)

        Catch ex As Exception

        End Try
End Function


When calling the .Save() method, it takes about 15 seconds on this environment.
Any idea why such delay may occur or if there was another way to access the PR_SEARCH_KEY as that stage instead of calling .Save() ?

Thank you,
Yacin
Posted 04 Sep, 2023 14:32:35 Top
Andrei Smolin


Add-in Express team


Posts: 19122
Joined: 2006-05-11
Hello Yacin,

Check https://support.microsoft.com/en-gb/office/repair-outlook-data-files-pst-and-ost-25663bc3-11ec-4412-86c4-60458afc5253.

I don't think it's possible to access a MAPI property without saving the email.

Regards from Poland (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 04 Sep, 2023 21:22:05 Top