Add-in fails to suggest the use of a package with certain types of large files

Oct 30, 2008 at 4:08 AM
Hello Sir,

I encountered a difficulty for this application. The thing is, if you attach files from your outlook when you send email (not from package). If the file size exceeds the required size (such as 5MB), if will give you a message box. After you choose Yes, there is nothing showing on your email body area, unless you open then Package editor you can see the attachment. I think that this doesn't work for the users. Also, it looks like the Add_In only check the size for compressed files, some regular files such as PDF, Word, it doesn't check.
Oct 30, 2008 at 10:10 AM
Edited Oct 30, 2008 at 4:29 PM

If I understand properly, you are actually raising two points:

1) You are saying that when adding an attachment that is larger than 5 MB to your email, a message box is displayed and the attachment is not added to the email. Am I correct?

The purpose of the add-in is to transfer large files via a file transfer server rather than embedding such large files in an email which might be too large for the recipient mailbox. The add-in replaces large attachments with links to download the files from the file transfer server where they have been uploaded. Accordingly, there is an options dialog box which you can display from the menus and which allows you to suggest a file transfer via the add-in in the following circumstances: "only if the mail is larger than  X (by default 5) MB", "always" or "never". Anyway the message box which you mention requires that you confirm that the attachment that you have just added to your email should be removed from the email itself and added to a Velodoc package which should be transferred separately by the add-in. This is exactly the way it is supposed to work.

2) You also say that "the add-in only checks for the size of compressed files".

The add-in checks the message size as reported by the Outlook API so I really doubt this is the case. What you may have experienced is the following:
  • You add a 10 MB attachment to your Outlook email and because the add-in hooks the AddAttachment event and Outlook reports a message size of 10MB+ it suggests the creation of a Velodoc package. You answer "Yes" to the message box and the attachment is removed from the email and added to the package (.velodoc file added to the list of attachments). Now the message size is only a few KB;
  • Then you add a PDF or Word document which is only 1MB to your email. The add-in still hooks the AddAttachment event but because the message size reported by Outlook is now 1MB+, which is below 5MB, the add-in does not process the attachment which is added to the email as a regular attachment.
I hope this helps.
Oct 30, 2008 at 4:08 PM
Hi jlchereau,

What I found is that when you attach PDF files or DOC files with very big size (about 5 MB), the outlook never give you message. Unless you attch an compress file such as .rar, it gives you a popup to ask you if you want add the file into the package. How to  fix this bug? Thanks.
Oct 30, 2008 at 9:03 PM
Hi jlcherau,
I went through the code regarding to get the attachment size in outlook3, looks like for compress files such as .zip, .rar etc, it can return current size value, but for some files such as .PDF, .DOC, .XLS etc only return 64 always.
                Mapi.IMAPIProp objMAPIProp = MAPIHelper.GetMapiProp(attachment.MAPIOBJECT);
                //PropValue objFileNameValue = CGlobals.g_Instance.GetOneProp(objMAPIProp, MapiPropTag._ATTACH_LONG_FILENAME);
                Mapi.PropValue objSizeValue = Mapi.Globals.GetOneProp(objMAPIProp, Mapi.MapiPropTag._ATTACH_SIZE);

                lSizeRet = Convert.ToInt64(objSizeValue.Value);
Oct 31, 2008 at 5:39 PM
Edited Oct 31, 2008 at 5:46 PM
I have reproduced the issue and there is definitely a bug so let's start a work item.
Please continue the discussion at