Strange attachments when replying

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

Strange attachments when replying
 
degree




Posts: 34
Joined: 2010-07-27
Hello devs!
We have the following scenarios:

1. User clicks "Reply" to an email which has some inline attachments. Outlook asks whether to download those attachments or not. Users says "No". User adds some files as attachments. When sending the email in the attachments list there is an additional "~WRD000.jpg" file. How can I safely check that it has been automatically added and remove it? Our logic that checks for inline attachments says that this is not an inline attachment. I don't want to use fileName here in case a "real" attachment of that name is added by the user. Also according to what I found on the Internet this file name might differ (different numbers, no tilde etc.)

2. User clicks "Reply" to an email which has some inline attachments. This is an inline reply (no new Window is created). Outlook asks whether to download those attachments or not. Users says "No". Before sending the email I need to copy/duplicate it - with inline reply this is not possible with the mailItem.Copy() method so I am creating new mail and try to add inline attachments to it. However those inline attachments are added as normal files. This problem does not occur when user says "Yes" and Outlook downloads the external content. How can I add those files as inline attachments? Or better - how to detect that user chose "No" and external content is not downloaded? In this case I would skip adding those inline attachments altogether.
Posted 28 Jun, 2017 07:05:36 Top
Andrei Smolin


Add-in Express team


Posts: 14104
Joined: 2006-05-11
Hello,

Getting an extra attachment having a fixed name may be an indication of a COM object unreleased in your code.

degree writes:
How can I safely check that it has been automatically added and remove it?


I believe you look in a wrong direction. If all other COM add-ins are off, you should check your code for COM objects left unreleased. Or, if you suspect that your code creates these attachments, you can debug your code.

Oh! There is another way to get more information: Check if this issue is reproducible on a new empty add-in project.

#2. Are you saying that you create an inline attachment on a reply email and the attachment is added as a normal one after you do something on an original email? You can create a test add-in creating such an attachment after you click a Ribbon button. Is the issue reproducible in this case?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 28 Jun, 2017 09:57:02 Top
degree




Posts: 34
Joined: 2010-07-27
Is it still possible that the WRD file is added because of an unreleased COM object, even if the problem occurs only when user chooses "NO" when asked to download external content by Outlook? When users says "Yes" this problem does not occur. Downloading external content does not interfere with our code (I think).

Problem number 2 is solved now - we managed to get rid of manually copying the email. Only problem number 1 remains unsolved.
Posted 30 Jun, 2017 04:11:43 Top
Andrei Smolin


Add-in Express team


Posts: 14104
Joined: 2006-05-11
Hello,

If a new empty add-in doesn't produce this issue, I suggest that you commented out blocks of your code to find what causes it.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 30 Jun, 2017 04:56:57 Top