Monterey
asked on
How do I set view to current view in this lotus script?
I have this code:
Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As
Variant, Continue As Variant)
Dim session As New notessession
Set db = session.currentdatabase
Set view = db.getview("People")
Set ProfileDoc = db.getprofiledocument("Pic kerView")
' ProfileDoc.Pview = "People"
End Sub
And I want it to work no matter what the current view is.. so not just "People" can I have it work with "current view" ?
Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As
Variant, Continue As Variant)
Dim session As New notessession
Set db = session.currentdatabase
Set view = db.getview("People")
Set ProfileDoc = db.getprofiledocument("Pic
' ProfileDoc.Pview = "People"
End Sub
And I want it to work no matter what the current view is.. so not just "People" can I have it work with "current view" ?
Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As
Variant, Continue As Variant)
Dim session As New notessession
Set db = session.currentdatabase
Set view = db.getview("People")
Set ProfileDoc = db.getprofiledocument("PickerView")
' ProfileDoc.Pview = "People"
End Sub
When you're in a document, there's no "current view" in the sense sjef is thinking. If you want to know what view the document was opened from, you could use the expression Source.Document.ParentView .
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Dim ws As New NotesUIWorkspace
Dim uiview As NotesUIView
Dim view As NotesView
Set uiview= ws.CurrentView
Set view= uiview.View
One warning though: I noticed that playing too much with the CurrentView can lead to a crash of the Notes client. Sometimes, there is no current view, for example if you are on the Notes Workspace, no database open, and you type Ctrl-M. Similarly, you can click a database icon once, then click Create and then select one of the forms in the database. Or the database is set to open a form when opened, e.g. an enquiry form.