Discussion:
Word Addin with custom menu not working
(too old to reply)
Rui
2005-12-01 17:46:05 UTC
Permalink
I am creating an Addin in VB6 that add a new menu in Word.
This addin works perfectly in first instance of word. When I click in my
menu appears my “Hello Word” dialog.
When I open a new instance of word (for example, opening a new document),
the custom menu still appearing, but the events are not working (when I click
in the menu doesn’t happen anything).
Why?
What I am doing wrong?
Tks. Rui
Jan Hyde
2005-12-05 09:29:34 UTC
Permalink
Rui <***@discussions.microsoft.com>'s wild thoughts were
released on Thu, 1 Dec 2005 09:46:05 -0800 bearing the
Post by Rui
I am creating an Addin in VB6 that add a new menu in Word.
This addin works perfectly in first instance of word. When I click in my
menu appears my “Hello Word” dialog.
When I open a new instance of word (for example, opening a new document),
the custom menu still appearing, but the events are not working (when I click
in the menu doesn’t happen anything).
Why?
What I am doing wrong?
Tks. Rui
How are you adding the menu item? You can specify to create
items permanently or temporarily. If you create the
permanently, but your addin does not load the second time,
the items will be there but will not do anything.



Jan Hyde (VB MVP)
--
Why does Santa like to go down chimneys?
Because it soots him

[Abolish the TV Licence - http://www.tvlicensing.biz/]
Rui
2005-12-08 09:25:02 UTC
Permalink
This is my code to create menus. And the initial load behavior is Startup.

--
Dim WithEvents icl_oApplication As Word.Application
Dim icl_oCommandBars As Office.CommandBars
Dim icl_oMenuBar As Office.CommandBar
Dim icl_oNewMenu As Office.CommandBarControl

' Customize the Menu structure
Set icl_oCommandBars = icl_oApplication.CommandBars
Set icl_oMenuBar = icl_oCommandBars.ActiveMenuBar

Set icl_oNewMenu = icl_oMenuBar.Controls.Add(Type:=msoControlPopup,
Temporary:=True)
icl_oNewMenu.Caption = "New Menu"

' botão Abrir
Set icl_oButtonAbrir = icl_oNewMenu.Controls.Add( _
Type:=msoControlButton, Temporary:=True, Before:=1)
icl_oButtonAbrir.Style = msoButtonIconAndCaption
icl_oButtonAbrir.Caption = "Item1"
--
Post by Jan Hyde
released on Thu, 1 Dec 2005 09:46:05 -0800 bearing the
Post by Rui
I am creating an Addin in VB6 that add a new menu in Word.
This addin works perfectly in first instance of word. When I click in my
menu appears my “Hello Word” dialog.
When I open a new instance of word (for example, opening a new document),
the custom menu still appearing, but the events are not working (when I click
in the menu doesn’t happen anything).
Why?
What I am doing wrong?
Tks. Rui
How are you adding the menu item? You can specify to create
items permanently or temporarily. If you create the
permanently, but your addin does not load the second time,
the items will be there but will not do anything.
Jan Hyde (VB MVP)
--
Why does Santa like to go down chimneys?
Because it soots him
[Abolish the TV Licence - http://www.tvlicensing.biz/]
Loading...