Hello,
Does anyone have the code to be able to change the Recent Files terminology on the application menu to something else? Also, how can I build this list programmatically?
Thanks!
Adding to 'Recent Files' and changing terminology
Re: Adding to 'Recent Files' and changing terminology
Hi Kevin,
To change the title (caption) of the 'Recent Files' you need to change the Caption property of the Ribbon.OfficeMenu.RecentFileList object, for example:
How to fill the list? There are two options:
1) Put your code to the OnBuildRecentFileList event/method of the Ribbon.OfficeMenu object:
2) Specify the function that fills the list in the Ribbon.OfficeMenu.OnBuildRecentFileListDelegate property, for example:
To change the title (caption) of the 'Recent Files' you need to change the Caption property of the Ribbon.OfficeMenu.RecentFileList object, for example:
Code: Select all
ThisForm.Ribbon.OfficeMenu.RecentFileList.Caption = "My Recent Files"
1) Put your code to the OnBuildRecentFileList event/method of the Ribbon.OfficeMenu object:
Code: Select all
LParameters taItems
Dimension taItems[ 4, ALen( m.taItems, 2)]
taItems[ 1, 1] = 0
taItems[ 1, 2] = "&1 Recent File #1"
taItems[ 1, 3] = "MessageBox( 'Recent File #1')"
taItems[ 1, 4] = "Open Recent File #1"
taItems[ 1, 5] = 0
taItems[ 2, 1] = 0
taItems[ 2, 2] = "&2 Recent File #2"
taItems[ 2, 3] = "MessageBox( 'Recent File #2')"
taItems[ 2, 4] = "Open Recent File #2"
taItems[ 2, 5] = 0
taItems[ 3, 1] = 0
taItems[ 3, 2] = "&3 Recent File #3"
taItems[ 3, 3] = "MessageBox( 'Recent File #3')"
taItems[ 3, 4] = "Open Recent File #3"
taItems[ 3, 5] = 0
taItems[ 4, 1] = 0
taItems[ 4, 2] = "&4 Recent File #4"
taItems[ 4, 3] = "MessageBox( 'Recent File #4')"
taItems[ 4, 4] = "Open Recent File #4"
taItems[ 4, 5] = 0
Return .T.
Code: Select all
ThisForm.Ribbon.OfficeMenu.OnBuildRecentFileListDelegate = "ThisForm.GetRecentFileListContent"
Code: Select all
*** Procedure Form.GetRecentFileListContent
LParameters toControl, taItems
Dimension taItems[ 4, ALen( m.taItems, 2)]
taItems[ 1, 1] = 0
taItems[ 1, 2] = "Custom item #&1"
taItems[ 1, 3] = "MessageBox( 'Custom item #1')"
taItems[ 1, 4] = "Custom item #1"
taItems[ 1, 5] = ThisForm.Ribbon.TabHome.GrpClipboard.cmdCut.GetIconID()
taItems[ 2, 1] = _ACB_CIO_CHECKED
taItems[ 2, 2] = "Custom item #\<2"
taItems[ 2, 3] = "MessageBox( 'Custom item #2')"
taItems[ 2, 4] = "Custom item #2"
taItems[ 2, 5] = 0
taItems[ 3, 1] = _ACB_CIO_DISABLED + _ACB_CIO_BEGINGROUP
taItems[ 3, 2] = "Custom item #&3"
taItems[ 3, 3] = "MessageBox( 'Custom item #3')"
taItems[ 3, 4] = "Custom item #3"
taItems[ 3, 5] = 0
taItems[ 4, 1] = _ACB_CIO_BEGINGROUP + _ACB_CIO_MRU
taItems[ 4, 2] = "Custom item #&4"
taItems[ 4, 3] = "MessageBox( This.Caption)" && 'Custom item #4')"
taItems[ 4, 4] = "Custom item #4"
taItems[ 4, 5] = 0
Return .T.
With best regards,
Alex Grigorjev
(ARG-Software Design Lab.)
Alex Grigorjev
(ARG-Software Design Lab.)