Powerpoint Add-in: How to create downloadable add-in which modifies Ribbon and calls macros? - vba

I create customised Office solutions for my organisation. To do this, I create Powerpoint/Excel templates which contain customisations I include by modifying the ribbon using Custom UI Editor - the buttons then call macros I wrote in VBA.
Right now, I am facing the problem that I need to keep rolling out new templates (and manually getting people to use it) whenever I want to fix bugs or update features. This is obviously not optimal.
Therefore, I wanted to build an Add-in which:
Modifies the ribbon in a similar way to Custom UI Editor
Can allow me to call VBA macros
Can be updated via the internet
However, (definitely because I'm new to this) the advice out there seems a little vague.
Is it possible to do what I am asking?

Microsoft has 3 different technologies that are all called add-ins. The one you're familiar with is the original VBA-based add-in. That technology can fulfill #2 on your list. However, there is no simple way to directly modify the Ribbon using VBA. It might be possible to update from the Internet, but that would not be an easy project to program.
The second technology is called COM. COM add-ins are most often written in C# or Visual Basic (similar to, but not identical with, VBA) in Visual Studio. COM add-ins can modify the Ribbon and can call VBA macros. Updating from the Internet would still be a more complex problem. Customize the Office Fluent ribbon by using a managed COM add-in
The third type of add-in is the JavaScript add-in technology that Microsoft is currently hyping as the next big thing. There are some UI elements they can manipulate, but not full-scale Ribbon mods. They can't run VBA macros. But they are update-able from the Internet. Understanding the Office JavaScript API

Related

Export a Outlook form written in VBA

I recently wrote a form in VBA for Outlook and saved it to my personal form folder.
Now this form should get exported in a userfriendly fashion. What is the best practise here?
I know that you can go to File -> Export file... in VBA, but this seems to have caused some problems in the past and doesn't seem very intuitive to use both the frm and the frx files.
The form is supposed to be accessed by employees to book their holiday.
That is COM add-ins were invented for. They are designed to be installed on multiple machines and users. VBA macros are not designed for transferring the code - the infrastructure doesn't provide anything for moving solutions automatically like you could do in case of COM add-ins. You need have do that manually in VBA.
If you consider moving your solution to the add-in rails, see Walkthrough: Create your first VSTO Add-in for Outlook to get started quickly. You may choose VB.NET which has a similar syntax with VBA.

Interacting with other addins

I am using word 2007 Version and came across one problem and looking for a solution to it.
I am using Grammarly Add-in for word and I am looking for a way to accept all the suggestions that Grammarly add-ins provide. I try to record a macro so that I can have some insight into the possible solution. But the macro recorder does not record anything while working within that add in.
The best what you could do is to contact Grammarly add-in developers to provide any public interface implemented in the COM add-in and which can be consumed by third-parties. The following walkthrough demonstrates how to expose an object in a VSTO Add-in to other Microsoft Office solutions, including Visual Basic for Applications (VBA) and COM VSTO Add-ins - Walkthrough: Call code in a VSTO Add-in from VBA.

How to save a word macro as an add-in

Trying to save a MS Word macro as an add-in, fully independent, portable and installable as a word tool. What kind of literature should I consult to learn this technique?
So far I've tried looking on Google and StackOverflow. Many people ask similar questions, no one seems to provide a valid answer.
In the end, I would like to be able to export a macro in the form of a exe/batch/whatever to be summoned/installed from word and customize the tools ribbon permanently, to conceal the macro sourcecode and easily propagate to other machines.
It's not possible to use VBA macros as exe or batch files. It is possible, however, to load a macro-enabled template as an add-in. All the functionality will then be available (Ribbon, keyboard shortcuts, macros, building blocks).
Save the document as a dotm file (template, macro-enabled)
Copy the file in the STARTUP folder. Word will then load it automatically.
For a "real" add-in that uses the same COM object model as VBA it's necessary to build software based on the IDTExtensibility2 interface. There are number of tools that use this, making things easier. Microsoft's VSTO (Visual Studio Tools for Office) is one that costs nothing.
Another alternative is to use the newer Java Script APIs for Office. These are, in the case of Word, incomplete as far as functionality for the object model is concerned (can't do everything the COM object model is capable of).

Converting powerpoint VBA add-in (.ppam) to COM add-in (.dll)

I have created a working Powerpoint add-in (.ppam) that offers several time saving features, and added a custom UI ribbon tab to improve accessibility.
As I look to distribute this add-in to users, I'm looking to improve code security by compiling it into a COM add-in (.dll) via VS Express.
I have looked all over the web for documentation on this, and have found some promising source, such as:
http://www.cpearson.com/excel/creatingcomaddin.aspx
Unfortunately, nearly everything I find appear to be quite outdated and based on Office XP or 2003, when I'm looking at Office 2010. I'm probably doing something wrong here, but I'm having trouble replicating their instructions on my end, running into errors like being unable to add a reference library or the code they suggest is not recognized. I actually am even unsure how to open for example the sample VB project that the Pearson site provides from the link above to imitate. I think all this may be because of the different versions of Office and Visual Studio, but could certainly be wrong.
Could anyone point me in the right direction? My understanding is that it's actually quite simple to convert the code from VBA to VB (just involves adding "Powerpoint.Application." in front of things like "activewindow"). So I just need to figure out how to convert a very simple VBA add-in into a COM add-in in VS Exp 2012 for Office 2010, and then can leverage the process to convert the full add-in.
Apologies if I'm using any of the terms incorrectly.

To separate code and document in Office automation

I'm currently working on an vba project to help document developers do their work better and faster.
The tool is helpful during the developing, but however, it's no longer needed after the document is complete.
So, is there any ideas, about how to export a pure document without vba code automatically? Or shall I do this stupidly by opening vba and remove all of its code?
Further more, Is there any ways, to automatically apply vba code to an existing document?
You can create an add-in. Your VBA code lives in the add-in, but operates on your documents. The add-in can create a custom menu to run your various routines.