Modify existing toolbar - Problem with Windows 2000

D

dani

Hi there,

I was trying to modify the toolbar containing the "save"-command and
replace the functionality with a self-written macro.

I've done the following:

uiObj := FApplication.CustomToolbars;

toolbarSetObj := uiObj.ToolbarSets.ItemAtID[visUIObjSetDrawing];

toolbarItemsObj := toolbarSetObj.Toolbars.Item[<standard_toolbar>];

toolbarItemObj := toolbarItemsObj.ToolbarItems.Item[<save_item>];
//disable default save
toolbarItemObj.CmdNum := 0;
//set new save
toolbarItemObj.AddOnName := 'ThisDocument.NewSave';

toolbarItemsObj.Protection := visBarNoCustomize;

FDoc.SetCustomToolbars(uiObj);

This worked fine with Windows XP. But when trying to run it on Windows
2000 on another machine, the second statement fails (for some unknown
reason).

Does anyone have an idea (or a better solution for doing this)?

Thanks for any help

Daniel
 
D

dani

ok, already found out what was the problem...

instead of

uiObj := FApplication.CustomToolbars

I took

uiObj := FApplication.BuiltInToolbars[visToolBarMSOffice]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top