码迷,mamicode.com
首页 > 其他好文 > 详细

如何获取系统菜单名列

时间:2015-06-03 13:33:36      阅读:193      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!