The following code is copied from Andrew Pitonyak’s guide. It works but only displays the windows/frames from within LibreOffice. It does not display the web browser and the files windows which are also open in the desktop.
Sub DisplayFrameTitles Dim vFrames As Variant 'All of the frames Dim vFrame As Variant 'A single frame Dim i As Integer 'Index to enumerate the frames Dim s As String 'Contains the string to print vFrames = StarDesktop.getFrames() 'Get all of the frames REM getCount() returns the number of contained frames REM If there are four frames, then i has the values 1, 2, 3, and 4 REM the getByIndex(i) method, however, is zero based. This means REM that it requires the values 0, 1, 2, and 3 For i = 1 To vFrames.getCount() vFrame = vFrames.getByIndex(i-1) s = s & CStr(i-1) & " : " & vFrame.Title & CHR$(10) Next MsgBox s, 0, "Frame Titles" End Sub
Clearly, I am misunderstanding what the code is meant to achieve. Can someone explain why not all the frames in the desktop are captured and displayed?