Embedded WPF form not showing within Outlook form region - outlook

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

Related

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.

Outlook 2007 Addin - LoadBehavior in registry always resets to 2

I know this has been asked before, but I've never found a solution to this. I created an Addin in Visual Studio for Outlook 2007. I created an Installer and copied the files and created the registry values. It installs perfectly on the developer computer and it uninstalls perfectly as well. But on the second computer, which is also Windows 7 32bit and Office 2007, the registry key LoadBehavior is always reset to 2 when Outlook opens. I edit it to say 3 and it just resets to 2 again. No error message or anything. This also happened on my computer at work.
Now, I did read something about this guy that tried installing Visual Studio on the computer and it would run just fine after. Made me think I need some other .NET library or something?
Why does this happen and has anyone ever found a solution?
In my case this turned out to be caused by an issue in a license protection wrapper from a third-party vendor. The issue has apparently been fixed in more recent versions of that product (contact me in private if you need more details).
Also, watch out for message boxes shown during Outlook startup. Outlook is really sensitive to those and AFAICT it has only gotten worse with Outlook 2010, especially under Windows 7.
Also, see this question of mine for links to a MS blog entry about this.

How do I set permissions on my VSTO outlook add-in?

I am trying to distribute my Outlook Add-In to the rest of the company.
I'm using Visual Studio 2008 Professional and Outlook 2003. In VS I used an installed template for Outlook 2003. It created a solution with BOTH a project and an installer.
I use the project and created an Add-In. It works GREAT on my PC in development. Now, I want to distribute it. Here's where things go haywire. The nice little installer they provide DOESN'T ACTUALLY WORK.
The installer runs and places the files where they are to go, but the add-in doesn't run. Instead it gets errors about not having permissions. The installer didn't automatically set the security settings for you.
No problem. You just have to set those settings... right? But no where can I find a simple list of those settings.
I've been to http://msdn.microsoft.com/en-us/library/bb332051.aspx a thousand times from almost every possible link on the web. I've read every Microsoft paper that I can find on VSTO add-Ins. Unfortunately everything seems to reference some magic script... "Just include the sample code..."
[rant] IF A SECTION OF CODE OR AN ENTIRE SOLUTION IS REQUIRED TO DISTRIBUTE YOUR CODE IT IS NOT SAMPLE!! IT IS REQUIRED !!! [/rant]
There. I feel better.
Since I installed VS2008, I don't have the directory:
C:\Program Files\Microsoft Visual Studio 2005 Tools for Office SE Resources\Samples
No problem, right? Just DL it from microsoft. I've downloaded every "vstor.exe" that I can get my hands on. They all offer to "repair or uninstall" my current installation, but no matter what I choose, the vstor.exe crashes.
HELP!!!
I just want to know what I need to do (the manual steps, if necessary!!!!!) to get my friggin app distributed.
No magic "include this gizmo". No fifty-thousand page diatribes.
Anyone know how this is ACTUALLY done?!
I got it to work.
I was able to get a "sample code" update from Microsoft that allowed me to follow the walk-through.
I still think that's utterly ridiculous to HAVE to use sample code to easily distribute your app. However it is working at the moment.
The link I used was given to me by anonymous use on a different board. Whoever you are THANK YOU!!!!
Here is the link I was given:
http://www.microsoft.com/downloads/details.aspx?familyid=6991E869-8D5B-45F4-91E7-B527BD236F4C&displaylang=en
This allowed me to actually get my hands on that mysterious "sample" code even though I use VS2008 Professional.

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.

What are possible problems switching from MSXML4 to MSXML6?

Due to problems associated with installing MSXML4 (like this) we want to switch to MSXML6. Are there any known issues associated with this or is such transition smooth and painless?
This comment isn't so much about the 4 to 6 transition as it is about the MSXML6 installer itself. Apparently some people do experience problems getting it installed properly. When not properly installed, it breaks the Add-In Manager in Visual Studio.
Quote from this page:
"There is a reported problem that happens when MSXML 6.0 is not installed correctly. In this case the Add-In Manager doesn't show any XML-based add-in (using an .AddIn file for registration). It shows only registry-based add-ins. So, if the Add-In Manager is empty when it should show several installed add-ins (not only yours), try reinstalling MSXML 6.0."

Resources