Outlook Form Region as a new window - c#

I am creating a new VSTO add-in for Outlook 2013 & 2016. I have setup a Ribbon (XML) with a button that fires an event, which eventually opens a standard WinForm. The design (Ribbon location, menu, popup window size & location, etc...) is based off the "Signatures" ribbon button under "New Message".
Everything is fine and dandy until I realized that some of the features I want needs Outlook-specific controls. Adding them to my project's toolbox, I found out that they can only work on Outlook Form Regions, and not standard WinForms. I am able to get this to work with the standard FormRegion under the "New Message", but this is not desired behavior. Instead, I would prefer to have it pop up much like the standard "Signature" panel.
I would prefer solutions in C#/VSTO. If a solution would require a third-party alternative to VSTO, I would rather implement this in C++ instead.

Related

Office VSTO add in, add custom button to starting tab of the backstage

I'm currently working on an office VSTO add-in, and one the requirements for the add-in is that it should place a custom button on the starting tab of the backstage. The overall goal is to make a user see that custom button as soon as he opens an office application.
The challenging part is that this should work for all versions of Office starting in Office 2016, and the starting tab the user sees when he opens an app changes from between Office versions.
So far, I've been trying to use the productReleaseId to identify the starting tab and load a custom Backstage UI accordingly. However, I haven't had much success with that approach as it seems that even product with the same productReleaseId might have different starting backstage tabs.
Any idea on how I can make a custom button appear on the starting tab independently of the office version used?

Shortcut keys do not work in a Custom Panel in a Visio 2013 add-in

I have created add-in for Visio but I have some problem related to Custom Panel. For implementing Custom Panel in Visio I used solution described in next link:
How can you add a Custom Panel in a Visio 2013 add-in?
My Custom Panel contain TextBoxes and Buttons. Buttons work correct and I can type text into any TextBox but I CAN'T insert text by using shortcut(Ctrl+V). When I type Ctrl+V my text is inserted in new shape of opened document. Another commands like Ctrl+X Ctrl+A etc do not work too.
How can I resolve this problem?
Visio intercepts many keyboard events before they reach your add-in. It provides "KeystrokeMessageForAddon" event though. You could check how it can be used in one of my Visio projects (it is specialized a bit for browser control but I hope it will give you an idea)
https://github.com/nbelyh/HtmlFormData/blob/master/HtmlFormData/HtmlFormData/ShortcutManager.cs

PowerPoint add-in - calling add-in functionality from a document shape

Short version: what is the preferred approach for embedding controls in a PowerPoint slide that send events back to an application-level add-in? The controls need to work in slide show mode and in design mode.
Long version:
I recently was brought into development on a legacy add-in for PowerPoint that (in a nutshell) pulls data from remote data sources and draws corresponding charts on slides. The add-in is managed code (C#), but is NOT built with VSTO - it uses custom wrappers and a COM shim.
The charts periodically need to be refreshed, and our add-in has a Refresh button in the toolbar for this purpose. In cases where a chart can't render at all until refreshed, we also embed a MSForms.CommandButton on the slide itself (as an OLE object). We have used this approach in a similar Excel add-in with success.
Unfortunately, it does not work in PowerPoint: the click event on the button does not seem to reach our add-in. I have found some information online that supports this observation. I have also tested it with a MSForms.ComboBox instead of a button and that worked--the combo box's change event reaches our add-in and the refresh succeeds.
So it seems that I need to find an alternative way to have the button communicate with our add-in. I can think of a few approaches and am wondering if there is a best practice:
Have the button (or a similar shape) run a macro that calls code in our add-in. I've heard that this might not work when the slide is viewed in Design Mode, but haven't tested yet to confirm.
Embed an MSForms form in the slide as well, to capture the click event and pass it on to our add-in. Again, this is just a theory and is untested as of yet.
Use something else entirely - something tells me there has to be a "modern" way of doing this, I'm just not familiar enough with Office development to know what that is.
I'll add that migrating to VSTO or a similar technology (such as NetOffice) is an option, but we'd prefer to avoid that if possible. Thanks!

Custom Ribbon in VSTO Addin for Outlook 2010 doesn't display

I've got a minimal VSTO Addin for Outlook 2010 with a ribbon. My only goal is to display a ribbon (created via designer) with no functionality. From what little I can tell from MSDN ribbons should just automatically be displayed by default, perhaps with tweaking ControlIdType/CustomId properties for tabs.
Alas, tweaking these properties does nothing -- Outlook loads and displays no tab. A simple message box displayed in the ribbon loader reveals it never is triggered. Additionally, I haven't seen any information resources (tutorials, walkthroughs, overviews, etc..) that say anything about needing to manually tell Outlook to display tabs.
How do I get the tabs displayed?
Is there a good resource other than MSDN that's good for VSTO newbies?
To get your ribbon displayed, on the base ribbon in your code change the RibbonType property to be Microsoft.Outlook.Explorer.
What fixed it for me (without starting a new project), in the Ribbon1.vb ribbon design, I clicked on the the Ribbon1 name above the ribbons 'File' button, in the properties pane, clicked on tabs (collection), under the heading 'Design' I changed the name (from Tab1) to something else.
Clicked ok, tested by clicking F5 and it worked. Hope this helps someone else.

How to navigate programmatically in an Office 2010 addin?

Does anybody know if it is possible (and in that case how) to navigate programmatically in an Office 2010 addin?
The idea is to create a settings button on a ribbon tab, that when clicked, will direct the user to the settings of the add-in that would be located in the backstage view. Is there a way to programmatically change the active view being displayed to the user or something like that?
Thank you!!
As a developer putting on the user spectacles, I find your approach not convincing. If I click on a settings button, I expect a well-designed dialog, not to be thrown into backstage view. On the other hand - as a developr I'm much more at ease with a well-designed Windows Form than with the controls Microsoft provides for the backstage user interface; I guess you'll find there more limitations then you like.
As far as I understand your question, you want to have two different entry points to your settings dialogue - one from a button in the ribbon, and another from a point in the backstage view. Why not combining and showing from both positions the same form? Also Microsoft provides you with additional dialogues, if you click on controls in the backstage view.
Technically:
If you want to start the action of a ribbon control, you can use the "ExecuteMSO" command of the application.commmandbar object, e.g. in Word you may use
Application.CommandBars.ExecuteMso "ApplicationOptionsDialog"
to open this dialogue. However, I've done a limited test to call a custom button in backstage view, and it failed. Sol I guess that you can use ExecuteMSO only for built-in commands.

Categories