Using OOo, open a document, edit it or change something (for example, move to another page or change the zoom factor), close the document, and open the document again. When you do this, the document opens at the same screen location, at the same size , with the same zoom factor as was active when it was last saved. This information is stored with the document and is available through the interface com.sun.star.document.XViewDataSupplier. This interface provides one object method, getViewData(). Listing 8 displays the view data for ThisComponent (see Figure 5 ).
Sub GetViewData Dim vViewData 'View data object Dim i% 'Index variable Dim j% 'Index variable Dim s$ 'General string Dim vtemp 'View data for one object vViewData = ThisComponent.getViewData() REM For each view of the data For i = 0 To vViewData.getCount() - 1 vtemp = vViewData.getByIndex(i) For j = 0 To UBound(vtemp) s = s & vtemp(j).Name & " = " & CStr(vtemp(j).Value) & CHR$(10) Next MsgBox s, 0, "View Data" Next End Sub