How to Expand OutlookFormRegion in C#? - vsto

I am facing am issue in Outlook VSTO addIn where OutlookFormRegion is used in Adjoining FormRegionType. So is there a way to change its state i.e. expand (if region is collapsed) via C#?
I could not find a location where this state persists? In my opinion, we can change this by accessing this?
Also share your thoughts if we can disable this expand/collapse option?
Any idea?

You'd be better off using Outlook Task Pane instead of a form region: https://learn.microsoft.com/en-us/visualstudio/vsto/custom-task-panes?view=vs-2022&tabs=csharp

Related

VSTO Addin - Own button type like "ShapeWidth" and "ShapeHeight"

I am currently working on an PowerPoint Addin and I am currently finishing the Ribbon. I'd like to create a control to change the size of objects that looks similar to the inbuild button "ShapeWidth" and "ShapeHeight":
However, I couldn't find the correct control type and hence I built the below by myself using an editbox and buttons. Although it's working I find the other style way cleaner but I haven't found the correct type.
Not all Ribbon X (Office Fluent UI) control types that Microsoft uses in its Office applications are made available to third-party developers. This, I'm afraid, falls into that category.
You should probably be able to get the image, at least, by specifying the idMso for the built-in control.

How to check for the active Application?

I made a VBA-Macro, activated via a Ribbon-Button for exporting selected Mails into a certain folder.
I'd like to make this Macro available in Word and Excel (for exporting doc/xls) into the same folder-structure.
Is it possible to check for the active application and then decide if a Mail(s)-Export or a simple Doc/Xls-Export should be done?
If you are working with multiple Applications probably the easiest way to identify one would be to use Application.Name property.
If you happen to have passed an object of some type that has the .Application property you can also call that. Refer to this post for details.
Also, with most MS-Office objects you can go up the hierarchy using the .Parent property to get all the way up to the Application, ie. .someObj.Parent.Parent.Parent.Application.Name

How to Select Masters Via Visio VBA

Is it possible to programmatically change the selected master within a specific stencil document in Visio, using VBA? If so, how would I go about doing it?
It doesn't seem possible to use the Window.Select method, since that seems to only work in the drawing page...
With Visio API only it is only possible to get selected master(s) using the Window.SelectedMasters property, but not set it (it is a readonly property).
So, there is no direct solution.
If you are okay with (sort of) workaround, you can take a look at mine here (the same question):
http://visguy.com/vgforum/index.php?topic=3378.msg13172#msg13172
It simply sends keyboard keys to the stencil window right number of times :)

Sharepoint WebPart DataSource

I'm learning how to develop webparts in SharePoint 2010.
What I'm having difficulty finding is how to allow the user to change the DataSource of the WebPart in the UI. I want to allow them to pick a list from the site, preferably of a specific type but one thing at a time.
Is there a specific control to do this or are you just supposed to expose a property of the webpart so the user can alter it?
There must be information on this out there but I'm having trouble finding it.
Does anybody have any good links on this subject?
Craig,
Using Web Part Property you can change DataSource from Edit mode and save it.
For custom webpart property click here.
Let me know if u have any query.
It sounds like it is the Content Query Web Part you are looking for.
This sounds like a great place to start reading:
"How to: Customize the SharePoint Content By Query Web Part by Using Custom Properties (ECM)": http://msdn.microsoft.com/en-us/library/aa981241.aspx
Good luck!

Custom View for my plugin in Outlook 2010 / 2007

I'm working to load my WPF control into outlook as a plugin. The only way it allows me to do is to add a custom task pane (which works perfectly fine), which is kind of hard at the UI. To maintain Outlook consistency, I would like to add my own view in the right-view of Outlook, so if the user clicks on some item in the navigation pane, I show my view. This would allow me to show Outlook data in my custom implementation to enhance the UX.
Can someone please let me know how to do this?
-Fahad
Fahad,
Please google up "outlook form region". This sounds like exactly what you need - create your own form region (using outlook's developer tab) and re-register a specific mail for that.
example:
reg.Create(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Office\\Outlook\\FormRegions"))
Best of luck!
Nili