Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Add-Ins / March 2004

Tip: Looking for answers? Try searching our database.

Attach a file, or not

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff Bienstadt - 31 Mar 2004 21:06 GMT
Is there a way to prevent or cancel an attachment?

When an Outlook user attempts to attach a file to a mail item, I would like
to be able to programmatically decide whether the attachment meets certain
criteria and either allow or disallow the attachment process to continue.

I've seen code which puts up a warning message box when the AttachmentAdd
event fires, but is there a way to prevent the attachment entirely?  Perhaps
an event that fires *before* the attachment is added?

If all else fails, is there a way to hook into the attachment selection
dialog box?  I know that Outlook puts up its own dialog, as opposed to
calling the Win32 GetOpenFileName API function.  Is this dialog something
that I can detect and intercept using an addin?

Any help or suggestions would be greatly appreciated.

Thanks

---jkb
Sue Mosher [MVP-Outlook] - 31 Mar 2004 22:35 GMT
No, there is no BeforeAttachmentAdd event, nor does Outlook provide a hook
for its dialog. An alternative approach might be to evaluate all attachments
when the user sends the message.

Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> Is there a way to prevent or cancel an attachment?
>
[quoted text clipped - 16 lines]
>
> ---jkb
Jeff Bienstadt - 31 Mar 2004 23:17 GMT
Thanks, Sue, for your prompt reply and your alternative suggestion.
Unfortunately, it's not what my customer wants.

Is it safe to delete the attachment while in the AttachmentAdd handler?  Are
there any hoops I'd need to jump through to make that work?

Thanks again,

---jkb

> No, there is no BeforeAttachmentAdd event, nor does Outlook provide a hook
> for its dialog. An alternative approach might be to evaluate all attachments
[quoted text clipped - 22 lines]
> >
> > ---jkb
Sue Mosher [MVP-Outlook] - 01 Apr 2004 00:44 GMT
I don't know. Why don't  you try it?

Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> Thanks, Sue, for your prompt reply and your alternative suggestion.
> Unfortunately, it's not what my customer wants.
[quoted text clipped - 37 lines]
> > >
> > > ---jkb
Graeme - 31 Mar 2004 23:35 GMT
Have you considered trapping the send event so that you can check if the
attachment(s) meet your predefined criteria.

If they do not then remove before sending and if appropriate display a
dialogue to the user.

--
Regards
Graeme
=====================================
Websetters - home of the WS:Outlook AddIn
the only limits are those of vision...
www.websetters.co.uk
=====================================

> Is there a way to prevent or cancel an attachment?
>
[quoted text clipped - 16 lines]
>
> ---jkb
Graeme - 31 Mar 2004 23:38 GMT
Sorry, just received the response from Sue... apologises for duplicating
response ...

Regards
Graeme
=====================================
Websetters - home of the WS:Outlook AddIn
the only limits are those of vision...
www.websetters.co.uk
=====================================

> Have you considered trapping the send event so that you can check if the
> attachment(s) meet your predefined criteria.
[quoted text clipped - 33 lines]
> >
> > ---jkb
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.