首页 > 其他 > 详细

如何获取系统菜单名列

时间:2015-06-03 13:30:38      阅读:208      评论:0      收藏:0      [点我收藏+]
1、在主界面模块上放置openoffice控件,并改名为MO1
2、添加如下过程
procedure TForm1.PrintAllMenuItem(AMainMenu: TMainMenu; XRow: Integer);
function FindChindMenuItem(AMeunItem: TMenuItem; YCol: Integer): Boolean;
var
i: Integer;
begin
MO1.SetCellString(Xrow,YCol,AMeunItem.Caption);
if AMeunItem.Count = 0 then
begin
Inc(XRow);
Exit;
end;
for i := 0 to AMeunItem.Count-1 do
begin
if AMeunItem.Items[i].Visible then
FindChindMenuItem(AMeunItem.Items[i],YCol+1);
end;
end;
begin
MO1.ExportType := theOpenOffice;
MO1.NewDoc();
FindChindMenuItem(AMainMenu.Items,1);
MO1.Disconnect;
ShowMessage(‘ComPlete!‘);
end;
 
3、在主界面模块放置一个Button控件,Button.Click事件代码为
procedure TForm1.Button1Click(Sender: TObject);
begin
PrintAllMenuItem(MainMenu1,1);
end;
 
运行系统,点击Button即为转出系统菜单项的Excel档。

如何获取系统菜单名列

原文:http://www.cnblogs.com/jackxun/p/4548707.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!