tags:

views:

420

answers:

1

How do you read and write RibbonApplicationMenuBar recent items to a file or Inifile?

The help file is not very helpful for getting at the list of recentitem strings to save and reload the recent items. I can add items to the recent items list by Ribbon1.AddRecentItem( APathFilename ) and open the file associated with the recent item with the RecentItemClick event but i can not figure out how to save and reload recent filenames to the recent items list.

Bill

+1  A: 

The TRibbonApplicationMenuBar has a RecentItems property, which provides access to a list of each recent item.

// example code - untested.
RibbonApplicationMenuBar1.RecentItems.Items[1].Caption;

Another example for looping though each item.

// example code - untested.  
var
  count : Integer;
begin
  For count := 1 to RibbonApplicationMenuBar1.RecentItems.Items.Count do
  begin
    ShowMessage(RibbonApplicationMenuBar1.RecentItems.Items[count].Caption);
  end;
end;
stukelly
I do not have a copy of Delphi with me to test, so the above code maybe incorrect ;o)
stukelly
Thank you for the code.
Bill Miller