Warning when file attached -- on sending

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know of some sample code that will fire when a file is attached to a message before being sent? What I'd like to do is cause a message to appear to a user when attaching a file that is larger than x MB (the value of x may change over time...). I'd like the dialog box to say something like, "The file you have attached is over x MB in size. It is possible the recipient's server will reject this message. Are you sure you want to send?" Then we'd have y/n buttons, etc. I know... Tell the users to pay attention, but that doesn't always work..

I'd accept suggestions on this project as well as any known resource for buying such code "off-the-shelf" because we're short on time. We're running a mixture of Outlook 2000 & 2003 in C/W mode with Exchange 2003

TIA
Bill W.
 
Bill-

There is an event- BeforeAttachmentSave - which may do the
trick. Otherwise, you may have to trap ItemSend, which is
cancellable, ie., if you find the attachment is too big.

Trapping Events that are not directly part of the
Application object requires a few extra steps- this
article may help:

http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnolbk02/html/odc_ch11olevents.asp

I don't know of any propety of a MailItem that would let
you check the size- the best I can tell you is to read the
FileName and PathName properties, concatenate them, then
use the FSO, or VBA file functions, to check the size of
the file in its location, using the path/filename you
concatenated.

Hope that helps,

-Andrew Cushen
======================================
-----Original Message-----
Does anyone know of some sample code that will fire when
a file is attached to a message before being sent? What
I'd like to do is cause a message to appear to a user when
attaching a file that is larger than x MB (the value of x
may change over time...). I'd like the dialog box to say
something like, "The file you have attached is over x MB
in size. It is possible the recipient's server will
reject this message. Are you sure you want to send?"
Then we'd have y/n buttons, etc. I know... Tell the
users to pay attention, but that doesn't always work...
I'd accept suggestions on this project as well as any
known resource for buying such code "off-the-shelf"
because we're short on time. We're running a mixture of
Outlook 2000 & 2003 in C/W mode with Exchange 2003.
 
Back
Top