VSTO, there is an event when i change open inspector? - c#

good day
I must add a button in the ribbon bar only for few specific mailitem,
i use this attribute to change the visibility.
getVisible="EnableControl"
and i use
IRibbonUI UIrib.Invalidate();
to update the ribbon, there is an event that run when i change focused ispector, so i can check if the button must be displaied or not
or a totally different way to do do this control?
Thanks for your support.
Best regards

You could refer to the link below: Switch focus to Outlook active window .
If you can't solve your problem, please let me know and I can give you a solution.

Whenever Application.Inspectors.NewInspector event fires, call IRibbonUI.Invalidate. Outlook will invoke all button state callbacks, including the getVisible callback.

Related

Oultook 2013 InlineResponse - Disable Forward button

I have a Form Server running in Outlook and I specify a different MessageClass (say IPM.Note.Test) for items which are to be handled by my form server. If you select an item, with MessageClass IPM.Note.Test, in the explorer view, and try to Forward from ribbon button, I prevent the user from doing so, by hooking into Forward command.
In OL 2013, if you have reading pane visible, and select an item in Explorer, you can see its preview and can Forward/Reply/ReplyAll from toolbar at the top of the reading-pane, which would create an InlineResponse.
I want to hook into this Forward action, and prevent the user from doing so, as I do for the Explorer-Ribbon Forward command.
I am aware of the Explorer.InlineResponse event which is fired on any action which creates an Inline Response, but this event is fired after the action, not before it, and it fires for Reply, ReplyAll and Forward, all three of them. I only want to intercept Forward. There is no information in the event to tell which action triggered it.
Is there a way to identify the the action which triggered the event, before the InlineResponse is created?
Or is there a way to stop the InlineResponse from being created? (From code, as I know you can disable it in OL options).
Or is there a way to disable these actions/inline response from Explorer.SelectionChange event?
I would appreciate any help.
Thanks.
MailItem object exposes the Actions collection. Retrieve the Forward action, set the Action.Enabled property to true, call MailItem.Save.
You need to set the Enabled property of the corresponding Action object instance to false. True if the action is enabled in the application and false - if the action is disabled.
Thanks guys for taking time to answer this.
Something else came up and I put this issue on hold for a bit.
As I mentioned earlier, I have my own Form Server with a different MessageClass. So the MailItem object I get in ExplorerSelectionChange event, is not a pure Outlook MailItem, its rather my MailItem and unfortunately, at the moment, its unable to get Actions property on it, probably because my Form Server implementation doesnt return a proper one.
So, although, for a normal MailItem, Enabled property will work, it doesnt solve my problem ... :(
I x-posted to Outlook Dev Forum as well, and someone suggested the following:
Private Sub myOlExp_InlineResponse(ByVal Item As Object)
Dim a As MailItem
Set a = Item
If a.To = "" Then
a.Close olDiscard ‘close the mail item
MsgBox "Forward is not supported"
End If
End Sub
Although a bit hacky, and not a great user-experience, but I'm taking this for an answer for the moment, as it works.
Shared here, in case someone else comes looking for it.
Complete thread

how to detect COPY/PASTE event on mouse right click event in C#?

I am able to catch the right click of the mouse but i want to catch RIGHT CLICK + COPY/PASTE event
I tried to search on net but unable to get a single proper answer.
I've found some useful hints in an other post:
If you want to handle the Paste operation yourself, before it even
happens, you will have to intercept the WM_PASTE message to the text
box. One way of doing is would be by creating a specialized control.
You can find the code here
Question is not clear to me
If you will add specifics I will try and help
I do what may be what you are asking with ContextMenu
This is cut, but you would use Paste
CopyToDigest would be your custom handler
CommandBindings.Add(new CommandBinding(ApplicationCommands.Cut, CopyToDigest, CopyToDigestOK));
I got it from the book Pro WPF by McDonnald

Is there an event which fires when the Layout Details screen is opened?

I'd like to write some code that fires when the layout details screen is opened. Is there an event, some sort of API or some way to hijack Sitecore UI to allow me to do this? There's nothing in the Sitecore.config events sectiont hat looks relevant.
What I want to do is capture the ID of the item for which I'm currently updating so that I can use it in custom controls later on.
I'm using Sitecore 6.6.
Marek Musielak's answer is great. An alternative would be to change the command fired from the 'Details' Button - Look for item:setlayoutdetails in the commands.config.
You could create your own class that does your work then instantiates Sitecore.Shell.Framework.Commands.SetLayoutDetails afterwards.
You can override the \sitecore\shell\Applications\Content Manager\Dialogs\LayoutDetails\LayoutDetails.xml and change its code beside:
<CodeBeside
Type="Sitecore.Shell.Applications.ContentManager.Dialogs.LayoutDetails.LayoutDetailsForm,Sitecore.Client"/>
to inherit from your custom class that will simply inherits from LayoutDetailsForm and overrides e.g. OnLoad method.

What Events does the Setting Charm fires?

Does a page is getting an event when the Setting Charm is closed?
Thanks
EitanB
There is no event when the pane is closed - depending on your particular implementation, you can either rely on CommandRequested - triggered when a specific item was selected, or on your independent handler that is in your Popup (that might show specific setting options).
Windows.UI.ApplicationSettings.SettingsPane.GetForCurrentView().CommandsRequested

Is it possible to put a "Clickable Link" inside of a Systray Notification Bubble?

Not much to add to this. Have an example?
No. There are two options though. The simplest is to just use the click event of the balloon to trigger the event you require. The more complicated one is to create a custom balloon within which you can present a link.
See http://www.codeproject.com/KB/miscctrl/taskbarnotifier.aspx for an example of how this could be accomplished.

Categories

Resources