I'm making an 'action' button from one document which will execute a
script and then go out to a certain view in the same database and
find a selected document and open it.
The part I'm having trouble with is 'open it'... Finding the
document is not a problem. Does anyone have any
suggestions/comments/questions/whatnot please enlighten me. This is
giving me a headache. I'm sure there has to be way... It is easy
enough to change a document, but all I want to do is open the document
and make it as the foremost screen in Lotus.
Notes 4.1: Developing on a Windows 95 unit w/ a windows NT 3.51
server. (And I would also call myself a Notes Newbie)
J e f f
Why don't you guys took a litle work instead of throwing qusetions over
questions without even read the threads that are going on?
> I'm making an 'action' button from one document which will execute a
>script and then go out to a certain view in the same database and
>find a selected document and open it.
> The part I'm having trouble with is 'open it'... Finding the
>document is not a problem. Does anyone have any
>suggestions/comments/questions/whatnot please enlighten me. This is
>giving me a headache. I'm sure there has to be way... It is easy
>enough to change a document, but all I want to do is open the document
>and make it as the foremost screen in Lotus.
The NotesUIWorkspace 'EditDocument' method will open the selected
document in the current view in either edit or read only mode. Maybe
this will help you.
I have a similar problem however. I want to create an action button to
open the currently selected document in a view using an alternate
form. I have looked through this news group and the NotesFAQ
programming tips and the manuals and the online help and haven't been
able to find anything. Maybe I didn't look hard enough, but if anybody
has some constructive suggestions I would appreciate hearing them.
Regards, Geoff Bartlett.
kes...@vianet.net.au
>je...@tmsdesign.com wrote:
>> I'm making an 'action' button from one document which will execute a
>>script and then go out to a certain view in the same database and
>>find a selected document and open it.
>The NotesUIWorkspace 'EditDocument' method will open the selected
>document in the current view in either edit or read only mode. Maybe
>this will help you.
the fact is a script manipulates the class DOCUMENT and and the EditDocument is
in UIWorkspace which applies to a selected (by a click in a view) document.
has someone a solution to this problem ? (find a document with a script and
open it)
>I have a similar problem however. I want to create an action button to
>open the currently selected document in a view using an alternate
>form. I have looked through this news group and the NotesFAQ
>programming tips and the manuals and the online help and haven't been
>able to find anything. Maybe I didn't look hard enough, but if anybody
>has some constructive suggestions I would appreciate hearing them.
use :
call workspace.dialogbox("your form",true,true)
defined in notesUIWorkspace class
hopes it helps
here's a solution i found in the Knowledge Base.
However, it's quite tuff !
Lotus Notes Knowledge BaseProduct Area:
Problem:
Using LotusScript, you would like to display a particular document on the
screen. The document is not the current document (which you could then display
on the screen using the NotesUIDocument method). Instead, the document is one
that is identified through a LotusScript backend method (the document meets, for
example, a certain criteria). How, using LotusScript, can this particular
document be displayed on the screen?
Solution:
Below is a sample application that illustrates one way to get a handle to a
particular document (via a backend method) and then make the document the new UI
document that displays on the screen. Specifically, the application performs
the following actions:
- Reads the UN-ID out of the instance of NotesDocument.
- Opens a temporary view selecting the document having the UN-ID.
- Opens the currently selected document.
- Switches to the temporary view.
- Closes the temporary view.
The exact steps to create this application are listed below.
1. Create a view with following attributes:
View Name: (DocUniqueID)
No Response Hierarchy: Enabled
Refresh Frequency: Automatic
View May Be Used By: All Users
Selection Formula: SELECT @All
Column Number: 1
Column Formula: @Text(@DocumentUniqueID);
Sorting: Ascending
2. Create a hidden script agent called (DisplayDoc).
'The subprogram Initialize is a sample script to get an instance of
NotesDocument.
'In this script, it looks for the first document in the view "test1."
Sub Initialize
Dim ws As New NotesUiWorkspace
Dim sess As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Set db = sess.CurrentDatabase
Set view = db.GetView("test1")
Set doc = view.GetNthDocument(1)
DisplayDocument doc
End Sub
Function DisplayDocument(doc As NotesDocument) As Integer
Dim ws As New NotesUiWorkspace
Dim db As NotesDatabase
Dim view As NotesView
Dim viewDoc As NotesDocument
Set db = doc.ParentDatabase
Set view = db.GetView("(DocUniqueID)")
Set viewDoc = db.GetDocumentByUnID(view.UniversalID)
ws.OpenDatabase db.Server, db.FilePath, "(DocUniqueID)", doc.UniversalID,
True
ws.EditDocument False
ws.OpenDatabase db.Server, db.FilePath, "(DocUniqueID)", ,False
'this line brings the temporary view to the top
End Function
3. Create a button with the following formula. (Note that @functions must be
used to close the temporary view.)
@Command([ToolsRunMacro]; "(DisplayDoc)");
@Command([FileCloseWindow])