VS 2005 Shared add in - adding button to toolbar with an office ad

J

johnm2565

Hi,

I wrote an office add in with vs 2003 recently. Having just installed vs
2005, I am struggling top repeat the task using VSTO2005 - it seemed much
easier in 2003 !!!

Here is my 2003 code

Public Sub OnStartupComplete(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnStartupComplete
'code that adds the button to the office applications

Dim oCmdBars As CommandBars
Dim oStdBar As CommandBar
On Error Resume Next

oCmdBars = applicationObject.commandbars

If oCmdBars Is Nothing Then
oCmdBars = applicationObject.activeexplorer.commandbars
End If

oStdBar = oCmdBars.Item("Standard")
If oStdBar Is Nothing Then
oStdBar = oCmdBars.Item("Database")
End If

btnPA = oStdBar.Controls.Item("PA")
If btnPA Is Nothing Then
btnPA = oStdBar.Controls.Add(1)
With btnPA
.Caption = "PA"
.Style = MsoButtonStyle.msoButtonCaption
.Tag = "PA"
.TooltipText = "Link to Professional Adviser"
.OnAction = "!<PAMSo.connect>"
.Visible = True
End With
End If

oStdBar = Nothing
oCmdBars = Nothing

Can anyone tell me what I need to change inorder for it to run with 2005 ???

Thanks in advance

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top