Outlook Addin Office Intitalize function in visual Studio 2017 - visual-studio

I am developing an outlook addin using visual studio 2017 outlook web addin template.
I want to handle the event when the addin was first installed.
How can I get the installation event.I refered this link but its not giving me any event information for addin.

Office.initialize is used for determining when an add-in is launched and the runtime is ready. When the event is invoked, it means that all Office.js APIs are ready to use. There is no event for when add-ins are installed. If you are looking to create a "First-Run" Experience, you may use the RoamingSettings object to set some kind of mark if user went through your guide and doesn't want to see it any longer. This object will be available right after Office.initialize, so you can try to get this mark (key) and redirect to your app page(s) or your guide page(s) according.

Related

Embedded WPF form not showing within Outlook form region

I have built an VSTO Outlook Add-in which creates customs emails based on some input events. The form region of these emails consist of an embedded WPF form which contains TextBoxes, ListBoxes, ListViews, buttons and things like that.
What happens is that sometimes the embedded WPF form is not displayed within the form region. I say "sometimes" because from my development machine under Visual Studio 2019 and .NET 4.5, it is always correctly rendered and displayed however if I create a new clean virtual machine (no Visual Studio 2019 installed on it), with only Outlook 2019 or 365 installed plus my add-in and .NET Framework, then WPF form is not shown (the form region appears empty/blank).
I have tried to compare differences between the development machine and the clean virtual machine to see if i need to install some type of complement in order to Outlook be able to render the WPF form but I am not be able to discover what is missed. I tried to install Visual Studio 2010 for Office runtime but even with that installed the form region containing the WPF form is not shown.
I don't know if maybe there is some Office key in the registry I must enable in order to make it work. Also I have taken a look at Outlook options to see if there are something to adjust but I haven't seen anything regarding to Outlook render engine.
I have not posted any piece of code here because I think it is not a code related issue since it is working perfectly in my development machine. I think it is something related to Outlook itself.
Any ideas on what can be happening?
It seems you need to modify the add-in installer to include all prerequisites and do the required windows registry modifications. See Deploy an Office solution by using Windows Installer for basics.
As for the form regions, you may find all the required information in the Specifying Form Regions in the Windows Registry article.
Finally I have solved, the problem was that in the deployed machine a key was missing under below path:
HKEY_CURRENT_USER/Software/Microsoft/Office/Outlook/FormRegions

Cannot select more than 1 email when invoking our Outlook Add-In

We just released our Office JS Add-In for Outlook. Our Add-In takes one or more emails and sends them to an external web service to upload as a case note attachment for our enterprise application. With the previous Visual Studio Tools for Office (VSTO) technology, we could invoke our Add-In with any number of emails selected so that many could be sent at one time. With the Office JS technology, if we select any more than 1 email, the Add-In button is not enabled and we can't invoke our Add-In. We have 12,000 customers using this tool using VSTO and they will report this as a bug for our Add-In given that the old technology works and the new technology does not. We would like this capability added for Office JS so our customers can do what they did using VSTO.
This is not possible today. We track Outlook add-in feature request on our user-voice page.
It looks like the feature you want has been requested by others already. Please upvote the existing request https://officespdev.uservoice.com/forums/224641-feature-requests-and-feedback/suggestions/11080962-allow-outlook-add-in-commands-to-be-used-on-select. Feature request on user-voice are considered when we go through our planning process.

Outlook 2016 Add-In doesn't work for some users

We've created an Outlook add-in which integrates our custom CRM with Outlook. A command button is added to messages in read and compose mode. A function file is called on the button click.
The add-in manifest passes validation and installs properly on all machines. However on Outlook 2016 desktop (only) we are seeing an error on some machines. The exact error message says: “We’re sorry, we couldn’t access [NCS Outlook Add-in]. Make sure you have a network connection. If the problem continues, please try again later.” ([NCS Outlook Add-In] is the name of our add-in.)
Note that this message appears IMMEDIATELY after clicking the add-in command button. It does not first say “[NCS Outlook Add-in] is working on your request” like it add-ins do when an error has occurred.
We have tried Outlook logging and haven't found anything useful in the logs. We've checked settings and disabled other add-ins. We have also tested across machines with user accounts. The same user will have the error on one machine and not the other. In short, it seems that the error is machine specific and not profile related.
Version of Office 365 installed: 1705 (Build 8201.2209).
We experienced this exact behavior in Outlook 2016, the solution was to enable protected mode for the restricted and internet zones.
The easiest way to change this is in IE.
In Internet Explorer, click the Tools button, and then click Internet Options.
Click the Security tab, and then select the Restricted Sites Zone.
Select the Enable Protected Mode check box, and then click OK.
Restart Internet Explorer.
Here is a little more information:
https://support.microsoft.com/en-us/help/2761180/apps-for-office-don-t-start-if-you-disable-protected-mode-for-the-rest
Try this:
1) Close Outlook
2) Rename the folder C:\Users\%USERNAME%\AppData\Local\Microsoft\Outlook
to C:\Users\%USERNAME%\AppData\Local\Microsoft\Outlook.OLD
(Where %USERNAME% is current User Name.)
3) Start Outlook, Setup User Profile
4) Add/Test Add-In.
If that works, then something broken on old Outlook profile. But if same problem: Exit Outlook, delete the Outlook folder and rename Outlook.OLD back to Outlook.
I ran into this exact same problem after uninstalling Visual Studio 2015 on my development machine. (I had been using Visual Studio 2017 for Outlook add-in development.)
The problem went away as soon as I reinstalled Visual Studio 2017. The Outlook 2016 installation had nothing to do with the problem, I never changed Outlook or its profile at all.
This would indicate that the problem is somehow related to the SDK tooling on the machine...perhaps something to do with the .Net framework?
If I ran into this problem on a customer machine I would try reinstalling or repairing the .Net framework, or perhaps reinstalling Outlook (assuming it contains some add-in tooling that is broken.)
Just passing this on in case it helps anyone else.

Create MSI file from c# outlook addin in VS 2013

I have c# outlook addin created in visual studio 2013.
It has windows forms also.
I am getting mad on generating msi file, any easier solution/steps for me, please ?
Mainly tell me, after completing the process, where do I find the final MSI file (like bin/release folder) ?
I installed this - https://visualstudiogallery.msdn.microsoft.com/9abe329c-9bba-44a1-be59-0fbf6151054d
as well as installshield limited edition installer.
I was able to build it and ran the installation file(.exe) from disks folder and it is installing but not showing anything in the outlook.
Take a look at the Deploying an Office Solution section in MSDN. It describes two possible options for deploying your Office solution in depth:
Deploying an Office Solution by Using Windows Installer
Deploying an Office Solution by Using ClickOnce
It is up to you which way is to choose.
I was able to build it and ran the installation file(.exe) from disks folder and it is installing but not showing anything in the outlook.
There are multiple reasons why you don't see your add-in in Office applications.
First of all, make sure that you did all the steps described in the previously mentioned articles. Then I'd suggest checking the required windows registry keys for COM add-ins, see Registry Entries for Application-Level Add-Ins for more information.
Microsoft Office applications can disable add-ins that behave unexpectedly. If an application does not load your add-in, the application might have hard disabled or soft disabled your add-in.
Hard disabling can occur when an add-in causes the application to close unexpectedly. It might also occur on your development computer if you stop the debugger while the Startup event handler in your add-in is executing.
Soft disabling can occur when an add-in produces an error that does not cause the application to unexpectedly close. For example, an application might soft disable an add-in if it throws an unhandled exception while the Startup event handler is executing.
You can read more about that in the How to: Re-enable an Add-in That Has Been Disabled article in MSDN.
Finally, you may also check out the Trust Center settings in Outlook. The Macro Security settings can be applied to add-ins as well. May be it is required to sign the add-in with a digial signature and etc.

Please explain what an outlook add-in is

Can someone give me a quick explanation of when I would use Visual Studio 2008 Outlook 2007 Ad-In project type? and how would that compare to developing a bunch of outlook macros directly in outlook?
Basically, I want to have some sort of application read email (with attachments) from a pop3 email box, do some filtering/editing/validation of the subject/sender/content and then if certain conditions are met, save the attachments to a local file, and then add an entry into an SQL server database table (i.e. date/sender/subject/message).
Seems there are at least 10 different ways to do this....so between an outlook macro and a VS Office Project, how do I pick?
I am not clear, if I create this solution as a Visual Studio outlook add-in, where does it run? Is it loaded into outlook, does it run as a separate process and communicates back and forth with outlook? if outlook is not running, does it start it?
An Outlook Add-on is a compiled component that uses the Outlook API to perform the tasks you need. A macro/VB script is an interpreted script that actually uses the same API. The add-on approach is better if you want to deploy your functionality.
When you work on an Outlook add-on in Visual Studio, you'll be creating a .NET component, which integrates into the Outlook application, which is written in C++ so uses COM. You'll have to be careful about managed/unmanaged types and releasing objects you retrieve from Outlook.
I have recently completed just such a tool, but I chose to use Add-in Express (http://www.add-in-express.com/). These guys provide a layer of abstraction over the [challenging] Outlook API and also provide some excellent support if you're stuck.
In my case, with Add-in Express, I "run" by setting Outlook as the application command to run, in the Project properties. Add-in Express sorts out the installation of the add-on within Outlook. So when I press "Run", Outlook starts and my add-in is displayed, which may be debugged in the normal fashion. I'm not sure how VSTO (Visual Studio Tools for Office) works in this respect - or at least, I can't remember.
This is an example of an outlook add-in..
Personally, I don't see macros distributable.

Resources