R
Ratnesh Raval
Hi all,
I am writing word 2003 com add-in using visual studio 2003 vb.net
I created a shared add-in, with one CommandbarCombobox. and on change event
i am running simple code, but its not running in word.
its showing a dialog box "the macro cannot be found or has been disabled
because of your macro security settings". my macro security settings are
'medium', i've checked to trust installed and visual studio addins , and i
dont have any disabled items.(in development machine on debug and/or release
mode)
The following code creates the CommandbarCombobox (i think there is nothing
wrong in the code that trigges this behavious from word)
Thanks
---------------------------------------------------------
Public Sub OnStartupComplete(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnStartupComplete
Try
oCommandBars = applicationObject.CommandBars
If oCommandBars Is Nothing Then
oCommandBars = applicationObject.ActiveExplorer.CommandBars
End If
oStandardBar = oCommandBars.Item("Standard")
Try
myCombobox = oStandardBar.Controls("Custom Combobox")
Catch ex As Exception
Dim omissing As Object = System.Reflection.Missing.Value
myCombobox = oStandardBar.Controls.Add(3, omissing, omissing,
omissing, omissing)
End Try
With myCombobox
.Caption = "Custom Combobox"
.Width = 50
.Style = MsoComboStyle.msoComboNormal
.TooltipText = "custom combobox tool tip"
.Tag = "Custom Combobox"
.OnAction = "!<MyCOMAddin.Connect>"
.Visible = True
End With
'MsgBox("Started in " & applicationObject.Name & ".")
Catch ex As Exception
End Try
End Sub
I am writing word 2003 com add-in using visual studio 2003 vb.net
I created a shared add-in, with one CommandbarCombobox. and on change event
i am running simple code, but its not running in word.
its showing a dialog box "the macro cannot be found or has been disabled
because of your macro security settings". my macro security settings are
'medium', i've checked to trust installed and visual studio addins , and i
dont have any disabled items.(in development machine on debug and/or release
mode)
The following code creates the CommandbarCombobox (i think there is nothing
wrong in the code that trigges this behavious from word)
Thanks
---------------------------------------------------------
Public Sub OnStartupComplete(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnStartupComplete
Try
oCommandBars = applicationObject.CommandBars
If oCommandBars Is Nothing Then
oCommandBars = applicationObject.ActiveExplorer.CommandBars
End If
oStandardBar = oCommandBars.Item("Standard")
Try
myCombobox = oStandardBar.Controls("Custom Combobox")
Catch ex As Exception
Dim omissing As Object = System.Reflection.Missing.Value
myCombobox = oStandardBar.Controls.Add(3, omissing, omissing,
omissing, omissing)
End Try
With myCombobox
.Caption = "Custom Combobox"
.Width = 50
.Style = MsoComboStyle.msoComboNormal
.TooltipText = "custom combobox tool tip"
.Tag = "Custom Combobox"
.OnAction = "!<MyCOMAddin.Connect>"
.Visible = True
End With
'MsgBox("Started in " & applicationObject.Name & ".")
Catch ex As Exception
End Try
End Sub