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
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