LS - How to get view of document which document is opened from (in previewpane)

Hello, I have document opened in preview pane. I would like to have button in this document with lotus script. Script can display name of the view from which was document opened in preview pane. Please could you help me? thank you, Jakub

Dim doc As NotesDocument

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set uidoc = workspace.CurrentDocument

Set doc = uidoc.document

Set parentView = doc.ParentView

Messagebox parentView.Name , , “parentView.Name”