Conditional Ribbon Tab Label based on Office version - vb.net

Developing an addin for Microsoft Office 2007 onwards (client requirements, yuck) but I am rusty with my VB. I am using Visual Studio 2008 to create the addin for all 3 major programs; Word, Excel and PowerPoint.
I was wanting to set a condition to rename the Tab inside of the Ribbon depending on what version of office they were running. But I have searched everywhere and cannot seem to find a way to accomplish this? I don't quite understand what Ribbon XML is and how it differs from the visual designer.
It would be great to get some explanation of how to access elements of the Ribbon and change them depending on the Application Version (whenever I try to reference Application.Version VB doesn't seem to know what I am talking about)
I can clarify more however any help including 'where to look' would be much appreciated, thank you :)

Related

Customizing Excel UI/Ribbon with VS2017?

Currently I have extended Excel with:
(1) VBA code.
(2) XML code using "Custum UI Editor for Microsoft Office" in which I customize the Ribbon.
I am also working with Visual Studio Community 2017, where I have some project coded in VB.NET. However, I am not at all familiar with C# or other languages.
My customizations in Exccel include dynamic menus as well as added build-in groups to custom tabs, so I don’t think I can use the "Ribbon designer".
I have been testing a little with Visual Studio for customizing the Ribbon of Excel, but the VBA code gives me problems with referencing to e.g. current selections of cells in Excel:
Private Sub FormatTusindtals0(control As IRibbonControl)
Selection.NumberFormat = "#,##0"
End Sub
And now I wonder whether Visual Studio is a better tool than the "Custum UI Editor for Microsoft Office" for customizing the Ribbon?
Any input to whether VS2017 is a better choice than "Custum UI Editor for Microsoft Office" – and how to get all my VBA Subs and Functions to work in VS2017 is very appreciated!
THANKS!

Using DatePicker control in VBA

I'm trying to add DatePicker VBA control in an PowerPoint 2007 slide. But I couldn't find any such control.
I have added Microsoft Office 12.0 Object Library as well as Microsoft Excel and Powerpoint Object Library, but still I couldn't find any control related to DatePicker.
I'd love if someone can direct me to some article or documentation, tutorial to add it.
The control isn't included with Office/VBA. If it's installed on your PC, the answer posted by Jean-François Corbett will get you there, but your code won't work on other PCs unless they also have the needed control installed.
Have a look here:
http://www.excelbanter.com/showthread.php?t=241456
Is this what you want?
Developer > Controls > More controls... (the hammer-and-wrench icon) > Microsoft MonthView Control

How to implement Custom Ribbon resizing in Excel 2007?

I'm working in a ribbon project for Excel 2007, using Visual Studio 2008 and VSTO, I'm trying to make my ribbon's groups collapse into galleries when I resize the Excel window, this is a functionality that the other tabs in the ribbon have (the tabs that come with Excel).
At first, I thought this wouldn't be that much difficult, I imagine that it would be like a property from the ribbon, but I have researched a lot about it and it seems that it is not that much easier.
I was looking at this article, there is a post from a guy called "Mike McGavin", he is asking for the same thing that I'm, and the guy that answer his question tells him that auto resize is not current functionality on custom groups/controls.
Now, that post is 1.5 years old...so I'm hoping something new has been out there, maybe some of you know something about it.
Thanks.
It's in 2010. Scroll down to Custom Group Auto-Scaling section.
http://blogs.technet.com/office2010/archive/2009/11/03/ui-extensibility-in-office-2010.aspx

Recording VBA code in Power Point 2007?

In Office 2003 if I recall correctly you had a "record macro" option.
In PowerPoint 2007, under View->Macros, you get a macro box. None of the options are "record". If you put in a name, you can select "create", but that takes you to the VB editor. If you edit the slide manually, it does not generate the VBA code.
You do not have the option of defining VBA code by a sequence of keystrokes/mouseclicks/whatever.
It seems you are out of luck What happened to the macro recorder?
I have since read:
Contrary to what Microsoft says, use
the legacy keyboard commands Alt+T, M,
R to start the macro recorder in
Powerpoint 2007, and use the same
keyboard combination to stop
recording.
The macro recorder works using this shortcut, but you should note that it won't record for features that were added after Powerpoint 2003 (and this includes anything to do with the new charting engine that was introduced in PPT 2007).
This isn't about arrogance, it's simply that 2007 was a BIG rewrite for all of the Office applications. To ensure that the product went out on time, some features had to be de-scoped and the macro recorder was one of them, since Powerpoint automation is used by a relatively small user group when compared with Excel or Word automation.
Powerpoint add-ins are common, but they're built by developers and although it's handy we can live without the macro recorder. Visual Studio isn't necessary for building Office Add-Ins, although it does have advantages. What you really need is someone competent in building Office solutions.
Both answers are correct the macro recorder can be activated but it is pretty much useless since it records little to nothing. It seems that the ppt programmers at MS really take issue with customers being able to customize powerpoint. Executing repetitive tasks or just formatting an object the way you want it (and not being stuck with the pre-cooked options that MS in its infinite wisdom or shall I say bloody arrogance believes is all you need) has become almost impossible. The only way out is to program the ribbon or create an add-in which has to be done in Visual Studio (VBA will not cut it).
The Keystroke activated record doesen't work it creates an empty macro with very few(usually none!) of the actual actions that you performed.

VBA Application Migration from Office 2002 to Office 2007

Looking for Migration from Office 2002 - VBA Word Doc Application to Office 2007.
Issues: Though Office 2007 Supports VBA Application - VB Macro Code, Menu Bars are not appearing. Indeed, VBA Macro Menus display under "Add-ins".
On a study, I realized Office 2007 Supports XML - Ribbon. Is there any ideal approach to migrate VBA Macro Application to Office 2007?
Your best bet would be these two MSDN articles: Customizing the 2007 Office Fluent Ribbon and Creating a Custom Tab by Using Ribbon XML, although they look like they focus on doing it across all applications, rather than just one. There help docs for each Office app, to get them all try this Google query: site:msdn.microsoft.com office 2007 add button to ribbon.
This snippet, from the first link, should be what you're looking for:
What About Existing Solutions?
In previous versions of Office, developers used the command bars object model to build the Visual Basic code that modified the Fluent UI. In the 2007 release of Office, this legacy code continues to work in most cases without modification. However, changes made to toolbars in Microsoft Office 2003 now appear on an Add-Ins tab. The type of customization that appears depends on the original design of the add-in. For example, Office creates a Menu Commands group that contains items added to the previous menu structure (such as the File menu, the Insert menu, and the Tools menu). Office also creates a Toolbar Commands group that contains items added to the previous built-in toolbars (such as the Standard toolbar, the Formatting toolbar, and the Picture toolbar). In addition, custom toolbars that are added by an add-in or document appear in the Custom Toolbars group on the Add-Ins tab.