Recommended approach for interception ?

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

Recommended approach for interception ?
 
Nilesh Padbidri




Posts: 11
Joined: 2006-12-08
Hi EB,

I need to intercept "File -> Save" functionality and in the intercepted code do some pre processing & conditionally decide whether to invoke the actual functionality & also do post processing.

One way to do it would be to capture the "Ctrl + S" keyboard shortcut & also capture "Save" menu command selection.

Is there another way to intercept "Save" functionality where in we hook into the MS Office events or something to that effect ?

Thanks in advance,
- Nilesh Padbidri.
Posted 11 Dec, 2006 14:06:44 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Nilesh.

What Office application do you want to intercept the shortcut for?


P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.
Posted 11 Dec, 2006 18:41:25 Top
Nilesh Padbidri




Posts: 11
Joined: 2006-12-08
Hi Sergey,

I am targetting Word, Excel, PowerPoint & Outlook.

The reason I want to know if interception at Office Object model level is possible or not is because, lets say I intercept the "Send To -> Mail Recepient" menu item.

However someone can still write a macro like the one mentioned below, that sends an email and my entire effort goes for a toss.

Sub SendTo()
Selection.TypeText Text:="This is a Test."
ActiveDocument.SendMail
End Sub

So I would want to disable the send mail functionality wholistically, not just through the user interface. Any gives ?

Thanks,
- Nilesh Padbidri.
Posted 12 Dec, 2006 20:33:23 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Nilesh.

To intercept the shortcut and menu commands you can use the ADXkeyboardShortcut and ADXBuiltInControl components. But not all shortcuts can be intercepted. It also depends on the application.
I think you need to try this in all applications mentioned above to realize if it is possible or not.
Posted 13 Dec, 2006 13:21:34 Top