Hello @Boca,
To export your Recently Used Documents list to a separate text file, you could call the following Basic macro:
Sub exportRecentDocumentsList( Optional strFile )
REM Exports the list of LibreOffice Recent Documents as URLs to a text file, in order of recency.
REM <strFile> : [OPTIONAL] Path to the text file to which the list of Recent Documents shall be exported.
REM If no argument is specified, the text file will be saved as "recent_documents.txt" inside your Home Folder.
Const strDefaultFile As String = "$(home)/recent_documents.txt"
If IsMissing( strFile ) Then strFile = strDefaultFile
Dim strHeader As String : strHeader = "LibreOffice Recent Documents ( Listed on " & Now() & "):"
Dim oPath as Object : oPath = CreateUnoService( "com.sun.star.util.PathSubstitution" )
strFile = oPath.substituteVariables( strFile, true )
strFile = ConvertToURL( strFile )
Dim aProps(1) As New com.sun.star.beans.PropertyValue
aProps(0).Name = "nodepath"
aProps(0).Value = "/org.openoffice.Office.Histories/Histories/"
aProps(1).Name = "enableasync"
aProps(1).Value = False
Dim oConfig As Object, oHistory As Object
oConfig = createUnoService( "com.sun.star.configuration.ConfigurationProvider" )
oHistory = oConfig.createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", aProps() )
Dim oOrderList As Object : oOrderList = oHistory.PickList.OrderList
Dim sOrderNames() As String : sOrderNames = oOrderList.getElementNames()
Dim iMaxIndex As Integer : iMaxIndex = uBound( sOrderNames )
REM Append the Recent Document URLs to the end of the file strFile.
Dim i As Integer
Dim iFNum As Integer : iFNum = Freefile()
Open strFile for Append as iFNum
Print #iFNum, strHeader
For i = 0 To iMaxIndex
Print #iFNum, oOrderList.getByName( sOrderNames(i) ).HistoryItemRef
Next i
Close #iFNum
End Sub
The list of recent documents can also be reached via the menu Tools : Options : LibreOffice : Advanced : Open Expert Configuration
,
and then in the dialog that appears browse to the node org.openoffice.Office.Histories/Histories/PickList
.
Hope it helps, lib
Yes, and it is as old as computer technology ... called back-up. Maybe starting to use a portable version of LibreOffice from a USB memory stick would help you big time with little effort. Keep your LO-portable installation and your files on a USB stick. This way any copy of this stick to an other stick, data carrier included your new reinstalled OS, ill contain all your files and all your presets of LO where ever you go.
Down side: this introduces the problem of managing multiple copies ;-)
Hi Henk, thanks for the input. I already backup all data files in multiple locations and wondered if I could get access to this "recently used" list so that it could be back-ed up also. Is there a specific file which contains this list? I like the idea of LO on a USB stick but would also need KMyMoney, etc etc to avoid similar issues with those progs. The problem might then be that if there is a problem with the USB stick... I could lose my LO recently-added files list this way also? Thanks,