Adding Office 2010 Interop (PIA) in Visual Studio 2012 - vb.net

I am writing an application in VB.NET that will send emails using outlook. My problem is that I need the Office 2010 PIA to do this. The following are the steps I have already tried (I am using Visual Studio Express 2012):
Restarted the machine
Downloaded Office 2010 PIARedist and installed it
Restarted Visual Studio
Restarted the machine again
Uninstalled Office and the PIA and re-installed Office, making sure that the PIA was selected in the installation options (it was already selected by default, so presumably I installed it the first time I installed Office as well).
Restarted the machine again
Downloaded Office 2010 PIARedist and installed it again
Restarted VS
After each of these steps, the PIA is still not available in "Add Reference" in VS, nor do the files exist on my computer at all (a search for "Microsoft.Office.Interop.Outlook.dll" confirms this). I am running Windows 7 on my MacBook Pro. Does anyone know what my problem is here? This seems like a ridiculous amount of headache for such a simple feature.
PS The only reason I need the PIA is to be able to add CC recipients on the email. That's it. If anyone knows how to do that without the PIA, please let me know because I'd much rather just do that and be done with it.
PSS Both times when I installed the PIA itself, the installation ended silently (no indication of success or failure).

In case anyone stumbles on this question, I finally figured out how to add the interop. For some reason, it won't show up in the "Add References" window (maybe it's because I have VS2012 (11.0) and I'm using Office 2010...?) Anyway, I had to manually browse to it to add it. It was located in C:\Windows\assembly (all of the Office 2010 interops were in there). Also interesting was that a search of the entire C drive for 'Microsoft.Office.Interop.Outlook' or shortened versions of that string turned up absolutely no results, even though they are on the drive. One last note: although 'Microsoft Office 14.0 Object Library' shows up in the "Add References" window, adding that reference did not allow access to the interop.

Related

Uninstall Atomineer

Looks like I am being held hostage by the Atomineer Pro Documentation add-in for Visual Studio! The trail period is over, I have no use for it! But now everytime I do something in Visual Studio I get an error message and get sent to their web site!
I have looked all over to find out how to uninstall it and have not found away to uninstall it!
WARNING TO EVERYONE - This Atomineer Pro is not easy to uninstall!! Just from the problems of uninstalling it, I would highly recomend no one ever installs it!
I ran into this too running on Windows 10 and VS 2013. Ended up installing and running IObit Uninstaller, which clean up the registry, but Atomineer was still loading in Visual Studio. My second pass was to search my C: drive for "Atomineer" which got several hits including some in a VS AddIns folder (I think). I just deleted everything and that did the trick.
Visual Studio 2015 onwards (Standard VS Extension)
In Visual Studio, go to Tools > Extensions and Updates, select Atomineer from the list, and click the Uninstall button.
Visual Studio 2005-2013 (Standard VS Add-in)
Use Control Panel > Programs and Features to uninstall it just like any other app, or
Run the Atomineer installer and select "uninstall", or
In the unlikely case that neither of the above work, you can manually search your drive and delete any "AtomineerUtils.Addin" files you find.
In any case if you have any problems, email Atomineer support and we'll be happy to help.

Cannot Develop Office 2010 Addin Using VS2013 or VS2015 with Office 365 Installed

I have Office 2010 installed (and Office 365 as it happens), and am trying to develop an Outlook 2010 Add-in using VS2013 and VB.
I create a new Outlook 2010 Add In. Compile and Run the default app ("ThisAddIn"). Outlook 2010 opens OK. So far so good. Exit Outlook 2010.
Save the OutlookAddIn project.
Close VS2013
Restart VS2013. Try to open the saved project/ .sln and then get a "One Way upgrade" splash screen. Why...????
Tried the "upgrade", and it fails. "One or more projects in the solution were not loaded correctly...etc etc"
Output windows shows: " The application for the project is not installed" (That seems to indicate the solution "thinks" it's looking for an Office version other than Office 2010, I believe)
Solution Explorer window shows "OutlookAddIn1(loading)...The project file will load in the background" and the "One-way upgrade" splash returns.
Cancel that.
Solution Explorer window now shows "OutlookAddIn1(needs migration)...The project file will load in the background".
I try "Reload Project" in solution explorer. It appears to do so.
I try to run the app again, I get a dialog saying " You cannot debug or run this project, because the required version of Microsoft Office application is not installed".
Check Project Properties and ALL references appear to have gone. (?????)
I've reinstalled VS2010 Tools. That didn't work either.
I have tried VS2015 and get exactly the same behavior.
So....... I uninstalled Office 365 completely. That didn't work either.
Any clues please?
I have solved the problem, but don't know for sure what caused it. I suspect there were some corrupted pointers in Windows that were "confusing" Outlook 2016 with Outlook 2010. The only clues I had to this were that in the Control Panel>Default Items>Set Your Default Programs, the default app for mail was shown as Outlook 2016, but its associated description was all about Outlook 2010.
So I did a complete uninstall of Office 365 (Office 2016) followed by a complete uninstall of Office 2010. I then cleaned out as many registry entries and folders associated with those as I could.
I then reinstalled Office 365, followed by Office 2010. Now I can develop an Outlook 2010 app in VS2013 or 2015 as normal. So the problem is apparently solved without knowing its cause.

VSTO Addin for Outlook won't work

I've seen tons of posts and sites that address this issue. I've tried every solution I've found but none of them work (I've been trying to figure this out for days now). I have seen many posts with the same exact sounding issue, but either the solution didn't work for me or isn't applicable. With that said...
I have an add-in for Outlook 2007 that is intended to add text to the an email's title and body. It is installed for all users using an .msi file. There is an older version that I deployed last year that works fine. The new version I created has only a few minor input/output changes, nothing major. This new version works perfectly on my development computer in both debug from Visual Studio and from an actual install. However, I can't get it to work on a non-development computer. Here are the details on the program and target computer (development computer and target computer details are the same other than the fact that the target computer doesn't have Visual Studio):
-Using Visual Studio Professional 2013
-Written in Visual Basic
-Target Framework is .NET 4.0
-The add-in is only run once the "send" button on an email is clicked.
-Outlook version is Outlook 2007
-Operating system is Windows 7 Enterprise SP1 32-bit
The problem is that the add-in won't load on the target computer(yes, I know, a bazillion other people have had the same issue). As I said previously, it works fine on my computer in both debug and installed versions. This made me think that the other computer is missing something, so I tried installing the .NET 4.0 framework onto the target computer but it told me that it was already installed. I ran through everything I could think of to get it to work with no avail. Here's how it behaves:
-Installs fine with no errors.
-HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Office/Outlook/Addins/EmailMarkTool/LoadBehavior = 3 after installation.
-VSTO_LOGALERTS = 1
-VSTO_SUPPRESSDISPLAYALERTS = 0
-Outlook opens with no apparent errors.
-LoadBehavior = 0 immediately after Outlook is opened.
-Shows up in the Add-ins under "Inactive Application Add-ins."
-Never shows up under "Disabled Add-ins."
-In the "COM Add-Ins" dialog where I can check which add-ins to use, it shows the correct directory and the Load Behavior is "Unloaded."
-The add-in can be checked. When I click "OK" I don't get any errors. When I go back to the Add-ins, it is unchecked and "Unloaded" again.
-Setting the LoadBehavior to 3 doesn't help because it goes back to 0 as soon as Outlook is started again.
-I inserted a try-catch block into the New() function of the add-in that has a MsgBox pop-up and a Throw.
-I get absolutely no errors anywhere.
-No log file is generated.
I have tried uninstalling, rebuilding, and reinstalling multiple times all with the same result. I just can't figure out why it will work on my development computer but not the target computer. Thanks for reading all of this. I know it's a lot, but I needed to get the details out. Thanks in advance for any input!
[UPDATE]: I just created a brand new minimal add-in just to test if it would work but got the same results.
I found the problem!
The problem may be unique to Outlook 2007. It turns out Microsoft Office 2007 SP1 and SP2 had a bug that prevented it from running VSTO addins. Microsoft released a hotfix that fixes this issue (https://support.microsoft.com/en-us/kb/976477). This was added in to the release of Microsoft Office SP3. However, to activate the fix, a new registry flag must be created but that isn't automatically done with the fix, making the fix useless until you manually activate it (instructions and download here). So...
To enable VSTO addins in Outlook 2007, you have to add a subkey to this registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Common\General\
and add a DWORD "EnableLocalMachineVSTO" with the value set to 1.
I did this, restarted the computer for good measure, installed my addin for the 23rd time, and it installed and ran perfectly! I'm not sure how previous versions worked, though. It's possible that our system admins removed that subkey in an effort to bolster security at some point.
The loadbehaviour key problem you are experiencing is strange. Whilst I think this is probably not your solution, it could be, so its worth a try.
The target computer will need to have VSTO tools for office runtime installed.
You can download these tools are the following link - https://www.microsoft.com/en-GB/download/details.aspx?id=48217

Database cannot open because VBA project cannot be read in MSAccess2010 file

An amateur programmer has made a nice little program that works through VBA on top of a MS-Access2010 database. We are asked to make an installer for this database+VBA project. The code runs fine on any computer with Office installed, but on computers without Office we get the error above. On computers without office we install the MS-Access2010 Runtime, which is free, in order to be able to open the .accde file at all. But this does not prevent the VBA error.
I did some research on the issue but did not find anything related to this specific scenario. How can this be troubleshooted?
The problem was a version mismatch between the .accde file (sp1) and the installed ms access 2010 runtime (original) After upgrading the runtime to sp1 all was fine.

My VSTO 3.0 Outlook addin doesn't load

I'm trying to diagnose why my Outlook plugin written in C#/VSTO 3.0/VS 2008 doesn't load after being installed.
The plugin works awesomely on my development machine, which has Visual Studio 2008 installed. I can't expect all my users to have all the prerequisites though so I went through these steps to write an installer:
http://msdn.microsoft.com/en-us/library/cc563937(loband).aspx
I installed the add-in on a fresh Windows XP SP 2 machine with a fresh install of Outlook 2007. It installs all the prereqs ok (.NET 3.5, VSTO 3.0 runtime, Windows Installer 3.1, 2007 PIAs). Outlook starts but the add-in isn't run. If I go to the Add-ins tab in the Trust Center, I see my add-in in the "Inactive Application Add-ins" section with the message "Not loaded. A runtime error occurred during the loading of the COM Add-in.".
Not sure how to find the specific error so I can fix it.
The reg keys look ok. Under HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\Addins\BlahAddin I see Description, FriendlyName, LoadBehavior (set to 3 until it fails after which if becomes set to 2), and Manifest.
Tried the VSTO_SUPPRESSDISPLAYALERTS environment variable trick and then launched Outlook from the command line but no output came out.
I have remote debugging more or less working but I'm not sure what to look for. I don't see my DLL loaded when I attach to Outlook, but then again maybe managed DLLs don't show up the same way in VS.
Any other ideas on next steps I could follow to produce a specific error I can diagnose?
Solved my problem after weeks of pain. The "Manifest" reg key was getting corrupted to some junk value during the setup build. It was a known Visual Studio bug that supposedly got fixed in Visual Studio 2008 SP 1, but apparently wasn't for me. Renaming the project name to be different from the plugin name fixed the problem. Random, huh?
Make sure you have try-catch handlers at the top level of all methods called by Outlook and log any exceptions you are unable to handle in some way. Focus your troubleshooting on methods like the Startup method and other methods called during initialization.
You probably want to debug this using the remote debugger. Share out the MSVCMON.EXE folder from your developer machine (in your Visual Studio folders in Program Files) on your test machine (share it with a UNC path), and launch Outlook under the debugger trapping (.NET) exceptions in your modules and putting breakpoints in your methods.
If you need to clean your test computer each time before you install your solution, you should probably run XP under a Virtual PC 2007 VM (free download) and switch to a differencing HD after setting up everything but your plugin to snapshot your pre-installed state once so you don't have to keep uninstalling/reinstalling as you make changes to your program to fix bugs.
Are you installing Debug builds or Release builds? Perhaps one flavor has different requirements. Just guessing.
-Mike [MSFT Office Dev]
On your machine, when you run the addin from Visual Studio, it should create a registry key in HKEY_CURRENT_USER\Software\Microsoft\VSTO\Security\Inclusion{SomeGuid}. Make sure that these registry settings are also being deployed with your addin. They are the ones that allow your code to be trusted.