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
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