Overriding Attach button in Outlook

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

Overriding Attach button in Outlook
 
Stepan Prokipchyn




Posts: 2
Joined: 2011-01-09
Hi.

I am developing Outlook plugin with Add-In Express for VCL.
I want to override adding an attachment to the new message. I need to know attachment's path so I cannot just use OnAttachmentAdd event.

So, I've overrided build-in controls for adding attachment (both in ribbon and toolbars, and also in main menu). When user clicks "Attach file" button, my add-in cancels standard action and shows my own dialog and after selecting a file, saves this file path.

I also did some trick to intercept inserting file from clipboard or Drag&Drop. In OnAttacmhentAdd add-in analyzes clipboard and gets file path.

All this works fine.But I found another way to add file to the letter. When one file is already added, we have 'Attach...' button under 'To...' button. And I could not find the ID of this button to override its action. I've looked in Add-in express Scanner, but no success.

So, my questions:
1. Could you, please tell me how can I find this ID (without Scanner, because I cannot find it in the list)?
2. Is there some other way to attach a file to letter which I need to intercept&
Posted 30 Jan, 2011 01:20:59 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Stepan,

Thank you for the detailed description. Please see my answers below.

1. Could you, please tell me how can I find this ID (without Scanner, because I cannot find it in the list)?


The "Attach..." button exists in Outlook 2002 and 2003 inspector windows only. Buttons that reside in locations other than in a command bar or a ribbon tab (such as "To...", "CC..." and "Attach...") do not have an ID and cannot be intercepted by using the Outlook Object Model.

2. Is there some other way to attach a file to letter which I need to intercept?


I think you have already listed all possible ways - buttons on toolbar/menu bar/ribbon tab, pasting from clipboard and drag-and-dropping a file.
Posted 31 Jan, 2011 05:32:08 Top