Outlook 2010 VSTO AddIn not loading - vsto

I have created a solution with a Outlook AddIn Project and a InstallShield LE Setup Project. I followed this Walkthrough to create the Setup Project:
Link
I installed my AddIn on a user-level. Here are some screenshots from my Setup Project:
Here I added the project output by going to "Add Project Output" and then selecting "Primary Output" from the list and clicking OK.
Here I added the registry keys for a user-level installation. I am not sure if what I did here is correct and I suspect that the error lies here. I have tried following the walkthrough but I am not sure if I added the keys for the AddIn and it's FormRegion correctly (The AddIn has exactly one FormRegion).
I added the FormRegion Manifest File according to this Walkthrough:
Link
Does anybody know what could be wrong here? I don't get any error messages and the AddIn shows in the COM-AddIn dialog in Outlook 2010 but after checking it, it doesn't load. After going into the COM-Addin dialog again, it has unchecked itself. I have also checked the disabled items, however, the AddIn does not appear here.

OK I found the problem. For some reason, the way I added the registry key for the FormRegion was not correct. The correct way is to add the Key with the corresponding class name, in my case IPM.Appointment. Then I had to add a string value with the full name, in my case Condato.Terminauswertung.CustomPropertiesFormRegion and the name of the Add-In with a preceding equal sign as value, in my case =Condato.Terminauswertung. You can find the first two values in the FormRegion class file near the top.

Related

BC32208: Locals debug window doesn't work, along with quick watches

Similar to this question, I'm having trouble with an old webforms project in vs2015. The code will compile and run without error.
If I enable a breakpoint and try to look at any value in a Quickwatch, I get the following error:
error BC32208: Project already has a reference to assembly
'projectname.resources'. A second reference to
'projectname.resources.dll' cannot be added.
Similarly, if I break into the code and hover the mouse over a variable name then I do not get a pop-up containing the variable's current value.
I also looked at this microsoft link to no avail.
Is there a workaround for webforms?
My project doesn't have any localized [culture-code].resx files.
There's no assembly tab in project properties.
Amber Zhang from Microsoft contacted me to inform me that this has been resolved in vs2015 update 2. Downloaded and verified today. Thanks Amber!

Word VBA Compile Error

I have a word document that has a few userforms and options to auto create an entire document. It works great on all of the installations I have tried from 2007 to 2013. The problem is that one user on one computer gets compile errors when it the user form is launched. The compiler complains that controls do not exist that actually DO IN FACT exist. I had him create a temporary account, just a simple test account, no admin permissions and it runs fine.
I have have tried killing the usual suspects
-.dotm files
- normal.dot files
- wiped word start up folders
- I have reset the word registry key
- I have renamed the appdata\Microsoft\office, appdata\Microsoft\word etc etc etc.
There are no missing references.
More oddities:
it complains about a missing control, lets just say frm.txtname.
I cut the sub that contains the reference and paste it at the bottom POOF it no longer believes the control is missing but...it finds another one to complain about.
I know it is something wonked up in the profile but I cannot find it.
Try this: In VBA editor open Tool bar and click References. You will see the list of references. Unclick those who starts with "MISSING". It should work.

Activating Reference in VBA Excel 2010 Project Programmatically

I developed a program in Word and Excel version 2010 using VBA. Within the VB IDE I created a form for which I added a ListView control to. In order to do this I had to open the tools window, right click on it, and select ListView as a component. It then became available to add as a component. It is using the MSCOMCTL.OCX. It functions perfectly on my device, but when I execute the program on another computer, the code raises an object error on the first line that addresses my ListView control:
Run-time error '424'
Object Required
With lvwLog
.ListItems.Clear <--- Error occurs here
.ColumnHeaders.Clear
All the computers in my company are configured/imaged the same way. All are using the same version of office, using Windows 7 Enterprise, and all will have the ListView 6.0 under the component's menu, just not selected. If I were to go into the IDE on the "foreign" computer and open up the form in design, the ListView is not there. You can probably guess that when I add it and name it the same as how my code is addressing it, this will then work on the other computer as designed.
There is no package and deployment wizard available in the Office version of the IDE, and even though I can probably find this, my end users will not go through the process of "installing" an Excel or Word document. If I can't find a way to get this control to register programmatically, then this application I wrote is just not going to get acceptance.
Though we have very few 64bit versions of Office, a different error is raised if opened on a device running the 64bit version of 2010:
System Error: &H80040111 (-2147221231). ClassFactory cannot supply selected class. This appears to be related to the same error, as it errors on the same line of the ListView code. Not sure if once I fix the above if I will need to re-write it in a 64bit version of Office.
Note: "Moving to another computer" simply consists of copying the DOCM or XLTM file to the device and opening it.
After further research I determined that the MSCOMCTL.OCX in the C:\Windows\System32 sub directory on my device was a much newer version than the OCX on the devices in which the code was failing on. This OCX is directly related to the ListView component I was adding to the form.
Once I copied the later version of MSCOMCTL.OCX (version 6.1.98.39, file date 3/31/2014) then the program ran and loaded the ListView control with no errors. Something else I will note is it is not necessary to re-register the OCX if it is being copied to the same system directory and with the same name. Simply copying to the system folder and overwriting the older file will suffice.

Adding DLL reference to VB.NET project

Just to start off, this question does seem very similar to another post Add the DLL (lame_enc.dll) reference to my project, but I haven't been able to successfully apply that answer. I am pretty new to VB.NET so it is very possible I'm simply missing something obvious.
I am trying to link a DLL to a VB.NET 2010 project to allow my VB app to play *.ogg files. I followed some other advice here on the forums and downloaded FMOD's FMOD Ex Programmers API. I am trying to now reference that functionality. These appear to be the files I need to somehow reference.
C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\fmodex64.dll.
C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\libfmodex64_vc.lib.
I haven't discovered how to add a *.lib reference (or the equivalent), but selecting the DLL as a reference gives the following error.
A reference to 'C:\Program Files (x86)\FMOD SoundSystem\FMOD
Programmers API Windows\api\fmodex64.dll' could not be added. Please
make sure that the file is accessible, and that it is a valid assembly
or COM component.
I'm not sure what I could be missing. Any ideas? Thanks!
In Solution Explorer, double-click the My Project node for the project.
In the Project Designer, click the References tab.
Click the Add button to open the Add Reference dialog box.
In the Add Reference dialog box, select the tab indicating the type of component you want to reference.
Select the components you want to reference, then click OK.
Another approach I was trying is working for me. I found a site with a working example of a LibZPlay VB.NET sample ( http://planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=7789&lngWId=10 ). It runs under VS 2008 and I was able to adapt my project to use LibZPlay (open source library http://libzplay.sourceforge.net/WELCOME.html ) under VS 2008.
That is sufficient for me for now. Thanks for your advice. It was likely some configuration issue or misunderstanding on my end.
Using VB.net 2015 I (could not add or even find a System32 dll) as a reference using Solution Explorer, Tab References. Going to the MAIN Menu, Projects/Add References...
Used Browse and All the System32 dll were visible. Then I was able to load the needed dll.

Where does Outlook store the VBA code files?

I had a VBA project in outlook with a few email macros - but after a PC crash they are all gone and all I see is a fresh 'Project1' when I hit Alt+F11
I'm not a VBA programmer, but had a collection of handy macros for email sorting etc. I would not like to have to code them again. Anyone know where the code files should be on the filesystem so that I might rescue the code?
This page has some really good insight on where Outlook keeps all its stuff. It suggests the following:
All Outlook macros are stored in a single file named VbaProject.otm in the user's %appdata%\Microsoft\Outlook folder, which will be a hidden folder on most systems.
Now, the problem is that if you do not see them now, then you probably won't be able to restore them from that location: there is probably either an "empty" project there or no project at all, but if that folder is being backed up, you might be able to restore it.
Moving forward, you might consider exporting your macros periodically in case this happens again, either through the VBA IDE (right-click and select Export File...) or using one of the tools mentioned in the linked article (like the Office Profile Wizard).
Ok. things to try to fix this...
I assume after the problem occured you tried logging back into the same windows user account, and the same Outlook profile.
Create a new windows login to the machine in question.
Login to this account and open Outlook, this will create a new outlook profile. make note of the profile name (to find this: Control Panel > Mail applet > Show Profiles...)
Now Exit Outlook, and make sure it is not running (check for outlook.exe in task manager).
Open Windows Explorer.
Copy (don't cut) the existing VbaProject.OTM file. (if it has any other name than that, first rename it to VbaProject.OTM, then copy).
Navigate to C:\Documents and Settings\USERNAME\Application Data\Microsoft\Outlook
(or use the environment variable notation %appdata%\Microsoft\Outlook for vista/win7)
Rename the existing VbaProject.OTM to VbaProject.OTM.OLD
Paste the VbaProject.OTM from step 5 into this folder.
Reopen Outlook and test (i.e. Alt + F11).
Good luck with recovery.
If this doesn't work do you remember adding self signing certificate at all? If so have you got a copy of the cert? you can try reinstalling it into the certificate manager (certmgr.msc)
copy/install it to the Certficiates - Current User\Personal\Certificates hive.
I just found this note from Sue Mosher (outlook VBA guru):
"AFAIK, once an .otm file is corrupted, it can't be recovered. That's why I recommend that people who rely on VBA code export their modules or backup the entire file. "
All macros are embedded into an OTM file, under the following location:
C:\Users\(***Your User Name***)\AppData\Roaming\Microsoft\Outlook\VbaProject.OTM
To restore, replace this file with the older one, it should work
Ran into this same problem.
First reviewed the .otm file mentioned by #Anonymous Type and #Dave DuPlantis
Not corrupted... hmm
I checked my Ribbon in Outlook for the Developer tab. It was missing and simply re-adding it to my Ribbon fixed my problem.