Incompatibility of V1 and V2

Add-in Express™ Support Service
That's what is more important than anything else

Incompatibility of V1 and V2
 
nick amel




Posts: 11
Joined: 2005-02-18
I've just moved to v2 cause you stated that the products are backward compatible.
I ahd the following code in v1 which now do not work @ all, what do i need so that i will be able to create a custom on words main 'menu bar' as i did with v1 ?
The error raised is that 'menu bar' dosen't exists and this is logical since you do not search any more that applications bar, but i need a fix on this

// Find 'menu 'Menu bar' menu bar
barName := '';
if hostType = ohaWord then
barName := 'Menu Bar'
else if hostType = ohaExcel then
barName := 'Worksheet Menu Bar';
if barName <> '' then
begin
IPopup := AddPopup(BarName, 'My bar name', 'mnu_tag', '', IsNew, -1);
AddButton(BarName, 'something', 'createpdf_mnu_tag', '', 'XXXXX', msoButtonIconAndCaption, IsNew, -1, IPopup);
end;

Posted 18 Feb, 2005 09:45:40 Top
nick amel




Posts: 11
Joined: 2005-02-18
Ok, forgeit it, the solution was to use a call of AddCmdBar('Menu Bar') so that the word's menu bar will be included in the know bars list
Posted 18 Feb, 2005 10:08:04 Top
Dmitry Kostochko


Add-in Express team


Posts: 2740
Joined: 2004-04-05
Hi Nick,

Yes, you are absolutely right, the resulting code should be like this:

// Find 'menu 'Menu bar' menu bar
barName := '';
if hostType = ohaWord then
barName := 'Menu Bar'
else if hostType = ohaExcel then
barName := 'Worksheet Menu Bar';
if barName <> '' then

begin
  [B]AddCmdBar(barName, IsNew, msoBarTop, False);[/B]
  IPopup := AddPopup(BarName, 'My bar name', 'mnu_tag', '', IsNew, -1);
  AddButton(BarName, 'something', 'createpdf_mnu_tag', '', '', msoButtonIconAndCaption, IsNew, -1, IPopup);
end;




Posted 18 Feb, 2005 10:15:51 Top
nick amel




Posts: 11
Joined: 2005-02-18
very fast reply to my problem, do i really need the call to be
AddCmdBar(barName, IsNew, msoBarTop, False);
or
AddCmdBar(barName, IsNew);
is sufficient, are theer any differences as far as regarding the functionality ?
Posted 18 Feb, 2005 10:21:35 Top
Dmitry Kostochko


Add-in Express team


Posts: 2740
Joined: 2004-04-05
Hi Nick,

In your case both code lines do the same, i.e. connect to a standard command bar.

Posted 18 Feb, 2005 10:49:14 Top