I made an Outlook macro. How can I deploy it to use it on some other machine?
Do I follow the same steps I followed on my machine Tools-> Macros-> create new or is there another way to deploy as we do with the vb or C# projects?
No, you don't need to follow the same steps and re-record the entire macro from scratch. You can save the module containing the macro and import it in Outlook on the other machine.
In Outlook's VBA editor, right-click your module > Export File...
Then on the other machine, in Outlook's VBA editor, right-click your project > Import File...
EDIT You say that your Outlook doesn't have VB Editor. Quoting from Outlook help:
you may be running a Microsoft Office
program with the Visual Basic for
Applications (VBA) shared feature disabled.
I don't know what version of Outlook you have, but for 2003:
To re-enable VBA, follow these steps:
1.Run the Office Setup program again. How? Quit all programs.Double-click
the Add/Remove Programs icon in the
Microsoft Windows Control Panel.Do one
of the following: If you installed
your Office program as part of
Microsoft Office, click Microsoft
Office in the Currently installed
programs box, and then click the
Change button.If you installed your
Office program individually, click the
name of your program in the Currently
installed programs box, and then click
the Change button.
2.On the Features to install screen in the Setup program, click the plus sign
(+) next to Office Shared Features.
3.Select Visual Basic for Applications, click the arrow next to
your selection, and then click Run
from My Computer.
Usually outlook macros are only made for personnal use. Distributing them can be hard as it needs too much actions made by the user (add "devoloper" in ribbon, open visual basic editor, import files, enable references, enable security...).
Microsoft wrote:
If you are developing a solution that you intend to distribute to more than a few people, you should convert your VBA code into an Outlook COM or VSTO add-in or an Office add-in for Outlook.
(source: https://support.microsoft.com/en-us/help/290779/managing-and-distributing-outlook-visual-basic-for-vba).
Knowing that, i recommend you to write a VSTO add-in and deploy it using ClickOnce.
You can start by these links:
VSTO
https://learn.microsoft.com/en-us/visualstudio/vsto/getting-started-programming-vsto-add-ins?view=vs-2019
ClickOnce deployment
https://learn.microsoft.com/en-us/visualstudio/vsto/deploying-an-office-solution-by-using-clickonce?view=vs-2019
Related
I am trying to write my first JavaScript Word add-in using Visual Studio Code. As a basis I used the Simple Word Add-in example provided by Microsoft. The example puts all JavaScript code in the commands.html file. I would like to put my code in the separate commands.js file, and use the Word Javascript API instead of the Common API. But with most changes Word just does not respond and I can't see what's happening at this stage.
I have installed the Microsoft Office Add-in Debugger Extension for Visual Studio Code. All examples that I have seen are task pane add-ins, and I was able to attach a debugger to those examples. Is there any way to debug a command add-in (without a task pane)?
Unfortunately the Microsoft Office Add-in Debugger Extension for Visual Studio Code will not work for debugging commands. In order to debug commands, your best bet is to upload your add-in manifest to Office Online, view it in Edge or Chrome and use the DevTools (F12). You should be able to add the add-in project source in the DevTools and just set breakpoints in the commands.
If you are running the Edge Chromium (which I don't think you are based on the fact that Microsoft Office Add-in Debugger Extension worked for taskpane add-ins), debugging commands can all be done in VS Code.
I am developing an add-in for Word to add ribbon bar functions for our business.
I am developing the add-in in VB.Net using Windows Visual Studio 2017.
The machine is currently a stand-alone machine that is not connected to the main network.
My issue is that for some reason, the add-in seems to have set itself up in such a way that it appears to have already been installed on the system and loads, with the most updated code, if I just start Word normally.
Any development has been done in Debug mode and I have not been re-building the solution in release mode, and yet anything I change and then run/debug updates the code that the add-in appears to be run off when opening Word directly.
If I go through the options --> add-ins and disable the VTSO add-in it just gets enabled again. I don't seem to be able to separate a debug/development section and live code.
Edit from comments: I can accept that the VTSO needs to be installed and registered but having no separation of live code and development code is frustrating. This machine is used by others for other purposes and this includes using Word, and so any old code must be kept as comments that can set back as the working code should I need to leave part way through. I cannot leave anything partially written as any run the debug mode will set the code as live.
What you're experiencing is normal behavior. When you debug, VSTO registers the add-in in the Windows Registry. This is all that's required for the Office application to find and load the add-in when it starts.
If you disable the add-in in Word, it will remain disabled until you again debug the add-in in Visual Studio.
If you share the machine and want to have the add-in under development disabled for other users:
Work with separate user profiles. VSTO registers its add-ins under CurrentUser, not for all users - VSTO isn't designed to register add-ins for the entire machine. OR
Get into the habit of using Visual Studio's Build/Clean Solution functionality when you leave the machine. That unregisters the add-in (until it runs in debug mode again).
I made a Word add in application in VS 2010 in C# and it was working fine until I installed the app using Advanced Installer in my development PC and its doesn't display anymore in the Word ribbon. I check the registry files and it looks fine, tried to add the same registry keys in the HKEY_CURRENT_USER and the HKEY_LOCAL_MACHINE directories in the registry Editor window but still no effect.
I even create another add in as a test and it wasn't displayed in the word ribbon.
When I check the Addin options in the Word option window the addin is located in the Active Application Addin which indicates that addin is loaded and working but still can't be displayed in the word ribbon.
I also tried to re-install the whole office package and restore the PC configuration to the date before installing the app but still nothing works.
The registry keys I use for the Addin are listed below:
Description: My_Addin
FriendlyName: My_Addin
LoadBehavior: 3 (DWORD (32-bit) value)
Manifest: file:///C:/Application folder/My_Addin.vsto|vstolocal
I have a PowerPoint Add-in. I created a setup for it and installed it. It works fine on my machine but the problem is when I install it on a fresh machine with a fresh copy of PowerPoint 2003, the add-in installs successfully but there is no COM Add-in option (menu) in PowerPoint in Tools -> COM Add-in and my add-in is not loaded.
I don't know why I have COM Add-in option in my development machine but not on the fresh machine. There must be some sort of setting or some other thing required before it can work.
So the question is there any other thing needed to download or install to be able to install COM Add-ins?
I developed the add-in in .NET 3.5 using C#, if that helps. Also I'm using Windows XP SP2.
Thanks.
I don't recall ever having seen a COM add-in option on the PPT 2003 tools menu, but I don't use .NET. Perhaps it's something that Visual Studio adds.
Or another possibility ... perhaps the menu item only appears when there are user-uninstallable COM add-ins installed.
With PPA add-ins, you can install them via registry entry in either HKCU or HKLM. If HKCU, then appear on the Tools | Add-ins dialog and the user can unload or remove them. If HKLM, they're hidden from the user.
I know there's one COM add-in installed to my copy of PowerPoint; just checked and it's registered in HKLM. Perhaps that's why there's no COM addins option on the Tools menu.
You can verify whether the COM add-in is loaded (even if from HKLM) with a bit of VBA run from within PPT:
Dim oCOMAddin as Object
For Each oCOMAddin In Application.COMAddIns
Debug.Print oCOMAddin.ProgID & vbTab _
& oCOMAddin.Description
Next oCOMAddin
That should at least tell you whether your add-in is properly loading or not.
I am trying to build a simple addin for Word 2007 using Visual Studio 2010 and .NET 4.0. It's a relatively simple addin, which brings up a save dialog and saves the document as a Word 2003 document.
The addin runs fine in Word under Debug mode, but does not run under Release or when I create a setup project for it. (It does create the registry keys under HKCU\Software\Microsoft\Office\Word\Addins and they look to be correct) I don't get any errors, and the addin isn't listed under the Disabled Addins either.
I tried adding the Addin manually but it says that it isn't a valid addin. The version of Office is 32-bit, running under Windows 7 64-bit.
Or are there even any alternatives to using VSTO (VBA?) that will let me add a tab to the Ribbon?
You can use IRibbonExtensibility interface (http://msdn.microsoft.com/en-us/library/microsoft.office.core.iribbonextensibility.aspx) to avoid using VSTO.