Using the Function Keys only with AdxKeyboardShortcuts (without Ctrl or Shift)

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

Using the Function Keys only with AdxKeyboardShortcuts (without Ctrl or Shift)
 
Peter Domke




Posts: 21
Joined: 2009-06-28
Hello Add-in Express Team,

I try to catch the F12 key (Word default shortcut for FileSaveAs) in my Word add-in using an AdxKeyboardShortcut.
Unfortunately the property "ShortcutText" allows me in the dropdown only to select the F12 key in combination with Ctrl, Shift or Ctrl+Shift. Why are the F-Keys alone missing?

In Word itself, I can use the KeyBindings statement to bind a function key alone to a macro.

I have a sort of horror that I must integrate Windows hooks to get the F12 key pressed event - if Add-in Express may provide the hook in a simple manner.

Using: Word 2003, Add-in Express 2009 Premium for .net (5.2.2024)

Thanks in advance
Peter Domke
Posted 24 May, 2010 08:30:47 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hello Peter,

Add-in Express was designed to intercept key combination only. Thank you for your suggestion.
.NET, Extended MAPI, Windows Phone & RT
Posted 24 May, 2010 10:38:23 Top
Peter Domke




Posts: 21
Joined: 2009-06-28
Hello Eugene,
thanks for the quick response.
Any changes to have it in the upcoming release of Add-in Express?

To mimic the standard opion of my clients, I'd say: "This can't be a lot of work, can it?" :-))

Kind Regards
Peter Domke
Posted 25 May, 2010 07:18:07 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Peter,

Please note that Word uses F12 to show the SaveAs dialog. Why do you want to intercept the F12? May be I can propose you a better solution.
.NET, Extended MAPI, Windows Phone & RT
Posted 25 May, 2010 07:47:31 Top
Peter Domke




Posts: 21
Joined: 2009-06-28
Eugene,
thank you very much for the proposal.

Here's the explanation; The client for whom I'm developing the add-in wants that before FileSaveAs document properties are correctly filled with metadata. So we need to catch all occurences of FileSaveAs, show a user dialog with edit fields and dropdowns and validation logic, and afterwards show the built-in Word FileSaveAs dialog.

In fact, I'm migrating a VBA-based solution which is running since 2000. In a VBA-based global Word add-in, I can simply catch the built-in command by naming a macro with the command name, e.g. FilePrintDefault, FileSaveAs, FileNew etc.
Using Add-in Express, I don't have this possibility and need to catch the F12 key for this reason, because with the Key users may have a workaround to overcome our document properties dialog.

Kind regards
Peter
Posted 27 May, 2010 01:53:08 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Peter,

Please try using the AddinExpress.MSO.ADXBuiltInControl component for old-fashioned command bars and AddinExpress.MSO.ADXRibbonCommand in the ribbonized host. I have just tested it on my PC with Word 2007. I can intercept the F12.
.NET, Extended MAPI, Windows Phone & RT
Posted 27 May, 2010 03:29:39 Top
Peter Domke




Posts: 21
Joined: 2009-06-28
I will test this. Thank you very much; I appreciate really the quality of support with your team.
Peter
Posted 27 May, 2010 03:44:37 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Peter,

Please let me know whether you are satisfied with this solution.
.NET, Extended MAPI, Windows Phone & RT
Posted 27 May, 2010 04:24:20 Top
Peter Domke




Posts: 21
Joined: 2009-06-28
HI Eugene,
with Word 2003, the FileSaveAs seems not to catch. The id of the FileSaveAs button is 748. I've created a basic project which contains nothing than two AdxBuiltinControls. One catches id 3 (FileSave) without problem, the other for id 748 (FileSaveAs) does not work (instead of the MsgBox the Word FileSaveAs dialog appears). Settings are the same for both Adx controls.
I've checked the id 748 twice.

You can download the sample project from here:
http://develop.domke-consulting.com/addinexpress/

Peter
Posted 28 May, 2010 06:37:51 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Peter,

Please try installing a fresh build of Add-in Express 2009. I have just sent you an e-mail with a link for download.
.NET, Extended MAPI, Windows Phone & RT
Posted 28 May, 2010 10:31:48 Top