Outlook BeforeAttachmentAdd

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

Outlook BeforeAttachmentAdd
 
Byung Kun Kim


Guest


I'm developing big file attachement feature using BeforeAttachmentAdd.

It works well when I attach *a* file bigger then my definition(If sum + currAttachment.Size > 3 * 1024 * 1024 Then), my BeforeAttachmentAdd event callback function catches the file and move to my external upload process, and "Cancel = True" for outlook's file attach process.

But if I add *multiple* files, total sum of them is larger then Exchange's MessageSize, Outlook shows messagebox says like "total sum is bigger then message size" and no BeforeAttachmentAdd event occurs. Maybe it seems like outlook's total attachment size validation occurs first and if the size limit over, outlook does no more process.

Do you know how to avoid or skip outlook's "Message size warning"?
Posted 28 Nov, 2016 03:38:25 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hello Byung,

At https://www.add-in-express.com/creating-addins-blog/2015/01/23/working-outlook-attachments-programmatically/#comments, we received a similar question describing a message that Outlook shows when you attach a big file (you can try to attach a 100 Mb file). Replying to that comment I wrote :

The Outlook object model doesn?Â?Ð?ét provide a way to bypass this restriction.

But I?Â?Ð?éve noticed that the dialog is shown after the AttachmentRemove event occurs on the corresponding MailItem object. I suppose you can use the event to identify this scenario; the event handler should provide the item being removed. If so, you can try to close the message box programmatically: I suppose you can study message box window attributes using Spy++, and use the attributes to identify the window and send it a message that it treats as a signal to close. Finding the window, learning such a message and sending it, are the tasks that you can try to solve using Spy++ and the Windows API.


This may or may not apply to your scenario. Still, I suggest that you use the Outlook Events Logger add-in to find more info about events that occur before you get the message box. You can use this info to detect this scenario. You download the Outlook Events Logger at https://www.add-in-express.com/creating-addins-blog/2010/07/01/outlook-events-tool/. Install the add-in, copy the source code to a location of your choice, uninstall add-in, build the project and register it.


Andrei Smolin
Add-in Express Team Leader
Posted 28 Nov, 2016 05:51:53 Top
Byung Kun Kim


Guest


OK, I will try it. Thanks!!

Andrei, today is my last 60 days support subscription day.
Posted 28 Nov, 2016 05:57:15 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hello Byung,

Byung Kun Kim writes:
Andrei, today is my last 60 days support subscription day.


Should you have any question related to this issue (also, all your issues which are currently open), don't hesitate to ask me.

If later on you have other issues, you will need to renew your Add-in Express for Office and .net subscription to continue getting technical support from us. As our registered customer you can do this for 50% of the full product price, please see the Subscription Renewal page:
http://www.add-in-express.com/purchase/version-upgrade.php?family=net


Andrei Smolin
Add-in Express Team Leader
Posted 28 Nov, 2016 06:10:42 Top
Byung Kun Kim


Guest


I really really appreciate for your expert support. Great tech support in the world!

I'll be back soon with new subscription. It's more worth then paying that price!!

Can you introduce PREMIUM edition success cases below to my email?


PREMIUM Code review
PREMIUM New features and bug-fixes at your request
PREMIUM Escalation of your issues to core developers
PREMIUM Wide-ranging solution research service
Posted 28 Nov, 2016 06:19:11 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Thank you Byung!

Byung Kun Kim writes:
Can you introduce PREMIUM edition success cases below to my email?


I'm afraid this isn't possible. The point is all such cases are under the NDA automatically; see https://www.add-in-express.com/custom-development/nda.php. You can find what our customers allowed us to publish at https://www.add-in-express.com/support/customers-say.php and https://www.add-in-express.com/success-stories.php.


Andrei Smolin
Add-in Express Team Leader
Posted 28 Nov, 2016 06:32:49 Top
Byung Kun Kim


Guest


OK. I got it. NDA is important.
Posted 28 Nov, 2016 06:36:08 Top
Byung Kun Kim


Guest


Ah, one more question. Do you know outlook 2016's HTMLBody throws not implemented exception?

It seems some version of 2016 throws the exception, I managed to resolve this issue with redemption.

Is there any ADX way or your comment about it?
Posted 28 Nov, 2016 06:43:57 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
In what scenario?


Andrei Smolin
Add-in Express Team Leader
Posted 28 Nov, 2016 06:46:54 Top
Byung Kun Kim


Guest


In..


Private Sub MailItem_Send(ByRef Cancel As Boolean) Handles mail2.Send
  Dim HTMLBody As String = mail2.HTMLBody '<-- throws exception
  Dim fileHTML As String = chtr.GetFileListHTML(_entryId2, 30)


same issue with below
https://www.add-in-express.com/forum/read.php?FID=5&TID=13476


http://screencast.com/t/qMx3julhi
Posted 28 Nov, 2016 06:55:38 Top