Open a file embedded in a VSTO Addin? - vb.net

I'd like to include a "help" file in my Outlook VSTO addin. I'd like it to just be a word doc which is somehow embedded in the addin in such a way that it doesn't just open the file from a network drive, but rather the word doc itself is part of the installed VSTO and the user can just open it from the addin. I am working in VB.NET. Ideas??

You can achieve this by adding the file as resource. Using visual studio it's as easy as peeling a banana. I use it to store my manual (A Word file).

Related

How to debug a Word OfficeJs command-only add-in

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.

Office 16 File Extensions not recognised by MS Access

Operating system is Windows 7. Recently offered updates to Office 2016 would not install so I reinstalled Office 2016. Reinstall worked but procedures in MS Access no longer work. I.E when trying to open a docx or xlsx file nothing happens; no error messages. A procedure designed to create a word file creates rtf. If I change the file extension of the files to .doc or .xls, things work. Docx and xlsx files open normally if opened directly, i.e. not via an Access procedure. Have done a “Quick Repair” of Office. Have decompiled Access.
In Control Panel/Default Programs, there is:"Set default programs". In Access, Excel and Word I made sure that all extensions were selected.

Word Addin application not displayed in the Word ribbon

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

Building/deploying a simple Word addin

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.

How to deploy an Outlook macro?

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