Queries with building visual basic solutions

Mar 25, 2013 at 11:42 AM
I have been going through the net office COMAddinTaskPaneExample. I notice the following lines are added at the start of the Public Addin Class sub (.Net 4.0)
Private Shared ReadOnly _addinOfficeRegistryKey As String = "Software\Microsoft\Office\Word\AddIns\"
Private Shared ReadOnly _prodId As String = "WordAddinVB4.TaskPaneAddin"
Private Shared ReadOnly _addinFriendlyName As String = "NetOffice Sample Addin in VB"
Private Shared ReadOnly _addinDescription As String = "NetOffice Sample Addin with custom Task Pane"
Are these lines added as a result from registering the assembly with regasm utility.

Also I notice the following when building the example project:
  • windows xp when I build the solution the Com addin is automatically added to word 2007 and works perfectly
  • windows vista and 7 can sometimes build the solution however cannot see the Com addin added to word. Note both windows vista and 7 have bit defender installed (whether that needs to be set up to accept the building of the solutions). Not sure.
And help on the above would be great appreciated
Developer
Mar 26, 2013 at 11:20 AM
Here is my assumption.
Your addin was automatically added to Word on Windows XP because you have administrator privilegies.
On Windows Vista/7 UAC prevents Visual Studio from automatic registering assembly for COM interop even if you have administrator privilegies. So your should manually register your addin with regasm.exe or run Visual Studio as administrator.
Mar 27, 2013 at 2:16 AM
No Windows XP is a work computer so do not have administration privileges. I think it could go back to your theory that Windows XP does not require registration. Have you found that Windows XP com addins require registration?

Also what do the following lines of code do. Why do all the examples have it:

Private Shared ReadOnly _addinOfficeRegistryKey As String = "Software\Microsoft\Office\Word\AddIns\"
Private Shared ReadOnly _prodId As String = "WordAddinVB4.TaskPaneAddin"
Private Shared ReadOnly _addinFriendlyName As String = "NetOffice Sample Addin in VB"
Private Shared ReadOnly _addinDescription As String = "NetOffice Sample Addin with custom Task Pane"