With MS Access Addin Installed right click "Save" is not working

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

With MS Access Addin Installed right click "Save" is not working
With MS Access Addin Installed right click "Save" is not working on the Designer View 
infovision007




Posts: 10
Joined: 2015-06-11
After Installing the MSAccess Addin Right Click Save Is not working

I Invoked the following save event in my Add-in

adxRibbonCommand1="FileSave"
adxRibbonCommand2="SaveObjectAs"
adxRibbonCommand3="FileSaveAsCurrentFileFormat"
and this.adxKeyboardShortcut1.ShortcutText = "Ctrl+S";


Without MS Access Addin :

Created A Table >> right Click on the Designer view of table >> Save >> It gives pop{ Save As =Tablename, ok, cancel}


With MS Access Addin :


Created A Table >> right Click on the Designer view of table >> Save > NO POP


Something is trapping this event from the Addin Code, I'm not able to debug this issue


Please let me what was causing this issue

Thanks
Robin
Posted 16 Jul, 2015 16:07:08 Top
Andrei Smolin


Add-in Express team


Posts: 17356
Joined: 2006-05-11
Hello Robin,

The components that you use intercept invoking the corresponding commands and shortcut; the don't invoke them. The event handler of the ADXRibbonCommand component lets you cancel the specified command; I suppose the command that doesn't work is cancelled by your code. As to ADXKeyboardShortcut, intercepting the shortcut means the host application won't receive it. If required, you need to write code that performs the action(s) associated with the shortcut.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 17 Jul, 2015 08:17:07 Top
infovision007




Posts: 10
Joined: 2015-06-11
Hello Andrei Smolin,


Thanks for quick response,

Based on the feedback I narrowed down the problem and created new MS Access Addin without implementing ADXRibbonCommand
event for "Save" "this.adxRibbonCommand1.IdMso = "FileSave";

And Checked below scenario:

Table >> right Click on the Designer view of table >> Save :IT WORKS FINE


But I need both the functionalities of "SAVE" with out intercepting each other

Please let me know if you have a solution for this


Thanks In Advance
Robin
Posted 18 Jul, 2015 14:09:14 Top
Andrei Smolin


Add-in Express team


Posts: 17356
Joined: 2006-05-11
Hello Robin,

I have a really vague understanding of what you need to achieve. Could you please explain? Do you need to invoke the save or to intercept it (in order to cancel or to perform some action)? In what scenario(s)?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 20 Jul, 2015 03:32:40 Top
infovision007




Posts: 10
Joined: 2015-06-11
Hi Andrei,


Sorry about that,


I'm trying to achieve the MS access ribbon "Save" event and query design tab "Save" event (Right click on query design tab and Save)

for the ribbon save event, I have below event handler in my code: (IdMso =FileSave)



private void adxRibbonCommand1_OnAction_1(object sender, IRibbonControl control, bool pressed, ADXCancelEventArgs e)
{

}

for the query design tab save event , I have below event handler in my code: (ID=3;)

private void adxBuiltInControl1_ActionEx(object sender, ADXCancelEventArgs e)
{

}

But I'm able get the adxRibbonCommand working but not the adxBuiltInControl

? Is this the way to go to achieve both events

Please let me know how get both events


Thanks In Advance
Robin
Posted 20 Jul, 2015 09:08:40 Top
Andrei Smolin


Add-in Express team


Posts: 17356
Joined: 2006-05-11
Robin,

For an ADXRibbonCommand I set IdMso="FileSave", and Enabled=False. This disables the Save button the context menu displays when you right-click the tab showing a query. This means you need to use the same IdMso. Nevertheless, clicking that button doesn't invoke the event handler of the ADXRibbonCommand.OnAction event. Moreover, if you click that button and then try to close the query, you'll get "Do you want to save changes ... ?" I think that button doesn't work at all.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 20 Jul, 2015 09:49:25 Top
infovision007




Posts: 10
Joined: 2015-06-11
Hi,Andrei

I do see this scenario, Does it mean it is bug ?

can you please explain more details on what would be the reason behind it ?

Thanks
Robin
Posted 20 Jul, 2015 10:25:07 Top
Andrei Smolin


Add-in Express team


Posts: 17356
Joined: 2006-05-11
As far as I can see it now, there's a bug in Access. My tests show there are two variants of the Save button in the Ribbon UI of Accesss. Both variants use the same IdMso="FileSave"; this is because using ADXRibbonCommand.Enabled=true disables both of the buttons. The Save button shown in the Quick Access Toolbar is intercepted if you use ADXRibbonCommand.ActionTarget=AddinExpress.MSO.ADXRibbonCommandTarget.Button. The Save button shown in the context menu of an Access tab (in which a table, query, etc. is shown) is intercepted only if you set ADXRibbonCommand.ActionTarget=AddinExpress.MSO.ADXRibbonCommandTarget.ToggleButton or ADXRibbonCommand.ActionTarget=AddinExpress.MSO.ADXRibbonCommandTarget.CheckBox. Using two Ribbon commands is impossible. Currently I'm trying to check if there's a chance to solve the issue. I'll let you know about my results.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 21 Jul, 2015 09:16:40 Top
Andrei Smolin


Add-in Express team


Posts: 17356
Joined: 2006-05-11
So, you need to have two methods handling the Save button differently; actually, we talk about two variants of the Save button. If you use one method, only one button variant is handled. When the Ribbon looks for a method handling clicking the other button, it can't find a method with a correct signature and fails. The idea is this: you can implement IDispatch and when IDispatch.Invoke() is called for a method handling the other button variant, you can call the method handling the first variant instead. It will take me some time to create a sample project. I think I may have such a project the next week.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 22 Jul, 2015 08:24:51 Top
infovision007




Posts: 10
Joined: 2015-06-11
Hi Andrei,

Thanks for the quick reply,

post the sample project at your earliest convenience

Thanks
Robin
Posted 22 Jul, 2015 11:34:08 Top