Skip to content

RecentFileListItem Object

Description

Represents an item displayed in a Recent File List (MRU List).

For a list of all members defined in this module, see RecentFileListItem Members.

Remarks

RecentFileListItem represents an item entry that is displayed in a RecentFileList and contains the caption, icon, file path name, and pinned status for the item.

When the RecentFileListItem is added to a standard Recent File List, the caption is what is displayed for the item in the list. This is also true for the Office 2007 style list. When using the Office 2010 style list, the caption is not displayed in the list.

The icon Id is only used to display an icon in Office 2007 and older recent file lists. Using the Office 2010 style list, this Id is not used, and instead, the icon used by the system for that file type will be used.

The path name is used to store the entire path including filename. For Office 2007 and older styles, the recent file list path name is displayed as a tooltip for the RecentFileListItem. The caption is only displayed for this item. For the Office 2010 style list, the path name is fully displayed in the item as two lines: the first line contains the file name, and the second contains the entire path to the file name.

The pinned state of the item will display a pin icon to the right of the item if Pinable is True for the RecentFileList. When the item is "pinned," it will be displayed at the top of the list, regardless of the order it was added. By default, items are listed in the order in which they were added. When "pinned," the pin icon will also change, showing that the item is indeed pinned.

Office 2010 Style List

Using the Office 2010 style BackstageListBox to display the RecentFileList:

Dim RecentFileList As RecentFileList

RecentFileListBox.ToolTipContext.Style = xtpToolTipResource

CommandBars.RecentFileList.Add "C:\Program Files\Test1.xml"
CommandBars.RecentFileList.Add "C:\Program Files\Test2.xml"
RecentFileListBox.CreateRecentFileListItems RecentFileList

Office 2007 Style List

Dim RibbonBar As RibbonBar  
Set RibbonBar = CommandBars.ActiveMenuBar  

Set ControlFile = RibbonBar.AddSystemButton  

Dim PopupBar As CommandBar  
Set PopupBar = CommandBars.CreateCommandBar("CXTPRibbonSystemPopupBar")  

Set ControlFile.CommandBar = PopupBar

CommandBars.RecentFileList.Add "C:\Program Files\Test1.xml"
CommandBars.RecentFileList.Add "C:\Program Files\Test2.xml"  

With PopupBar.Controls
    Set Control = CommandBars.CreateCommandBarControl("CXTPRibbonControlSystemRecentFileList")  
    Control.Caption = "Recent Documents"  
    Control.BeginGroup = True  
    Control.Id = XTP_ID_FILE_MRU  
    .AddControl Control
End With

See Also

RecentFileListItem Members


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.