Posts 1 - 10 of 13
First | Prev. | 1 2 | Next | Last
|
|
Uwe
Guest
|
Hi, how can I dynamically add a menuitem and submenus to the context-menu in MS Word?
Something like
MyMenuItem
SubItem1
SubItem2
SubItem3
|
|
Posted 09 Mar, 2005 13:08:25
|
|
Top
|
|
Dmitry Kostochko
Add-in Express team
Posts: 2887
Joined: 2004-04-05
|
|
Posted 10 Mar, 2005 06:40:09
|
|
Top
|
|
Uwe Thaden
Posts: 13
Joined: 2005-03-08
|
Thank!
Yes, I know that and I used your tool to get the IDs out of MS Word.
But I need to create the items dynamically at runtime.
And one more questions: Can you tell me if this works for all version of MS Word using adx?
Thanks,
Uwe |
|
Posted 11 Mar, 2005 03:11:34
|
|
Top
|
|
Dmitry Kostochko
Add-in Express team
Posts: 2887
Joined: 2004-04-05
|
Hi Uwe,
But I need to create the items dynamically at runtime.
It is more complicated but I think this example will help you:
http://www.add-in-express.com/projects/adx-word-context-menu.zip
I have just updated it.
And one more questions: Can you tell me if this works for all version of MS Word using adx?
It should work for MS Word 2000, XP and 2003. Our experience shows that there is difference only between some Outlook versions.
|
|
Posted 11 Mar, 2005 06:50:31
|
|
Top
|
|
Guest
Guest
|
|
Posted 11 Mar, 2005 11:01:01
|
|
Top
|
|
Guest
Guest
|
Upps -- I'm too stupid: I tried to create a submenu based on your example using:
// popup
Popup := adxCommandBar2.Controls.Add(adxPopup, 'POPUP_TAG', 0, True).AsPopup;
Popup.Caption := 'GetContact';
// buttons
with Popup.Controls.Add(adxButton, 'BUTTON_TAG_1', 0, True).AsButton do begin
Caption := 'Uwes Button 1';
Style := adxMsoButtonCaption;
// OnClick := CommonButtonClick;
end;
Popup2 := Popup.Controls.Add(adxPopup, 'POPUP_TAG_2', 0, True).AsPopup;
with Popup2.Controls.Add(adxButton, 'BUTTON_TAG_2', 0, True).AsButton do begin
Caption := 'Uwes Button 2';
Style := adxMsoButtonCaption;
// OnClick := CommonButtonClick;
end;
But that does not work :-(
Any help?
Thanks,
Uwe
|
|
Posted 11 Mar, 2005 11:29:13
|
|
Top
|
|
Dmitry Kostochko
Add-in Express team
Posts: 2887
Joined: 2004-04-05
|
Hi Uwe,
Hmm... What exactly doesn't work?
Could you please send me your project?
|
|
Posted 11 Mar, 2005 11:54:13
|
|
Top
|
|
Guest
Guest
|
Here is the method (I put one adxCommandBar on the form):
procedure TAddInModule.adxCOMAddInModuleAddInStartupComplete(
Sender: TObject);
var
Popup: TadxCommandBarPopup;
Popup2: TadxCommandBarPopup;
begin
// Handle
Application.Handle := GetActiveWindow;
adxCommandBar2.Controls.Clear;
// popup
Popup := adxCommandBar2.Controls.Add(adxPopup, 'POPUP_TAG', 0, True).AsPopup;
Popup.Caption := 'GetContact';
// buttons
with Popup.Controls.Add(adxButton, 'BUTTON_TAG_1', 0, True).AsButton do begin
Caption := 'Uwes Button 1';
Style := adxMsoButtonCaption;
// OnClick := CommonButtonClick;
end;
Popup2 := Popup.Controls.Add(adxPopup, 'POPUP_TAG_2', 0, True).AsPopup;
with Popup2.Controls.Add(adxButton, 'BUTTON_TAG_2', 0, True).AsButton do begin
Caption := 'Uwes Button 2';
Style := adxMsoButtonCaption;
// OnClick := CommonButtonClick;
end;
// ShowMessage('Startup fertig');
end;
I thought it would be like:
GetContact
Button 1
Popup 2
Button 2
But there is no submenu from Popup 2 having the Button 2 a item.
Thanks,
Uwe
|
|
Posted 11 Mar, 2005 12:08:05
|
|
Top
|
|
Dmitry Kostochko
Add-in Express team
Posts: 2887
Joined: 2004-04-05
|
|
Posted 11 Mar, 2005 12:42:05
|
|
Top
|
|
Uwe Thaden
Guest
|
Hi, it's 7:30 PM here, too ;-)
I just sent you an email with the result. I didn't change anything, but just compiled and ran. (I don't know how to attach a JPG here). It's quite different from the image you show.
It's MS Word 2002.
--Uwe
|
|
Posted 11 Mar, 2005 12:50:16
|
|
Top
|
|
Posts 1 - 10 of 13
First | Prev. | 1 2 | Next | Last
|