向在03例子中指示將「值」取出,我測試過程中若要在對取出的「值」加以邊化修飾,
必須注意使用以下的技巧:
'----------------------------------------------------------------------------------
docvalue = dialogDoc.GetItemValue("ListResName")(0) '取得User所選擇的"值"
'----------------------------------------------------------------------------------
2008年3月11日 星期二
2008年3月10日 星期一
03.當在DialogBox中,如果還想要開啟一個對話框,並且傳回相關值時,使用這個例子。
這個範例是當你已經開啟(設計)對話框DialogBox後,又想在開啟(設計)一個Dialogbox傳回值時
可以使用這個範例。
'-------------------------
Sub Click(Source As Button)
Dim s As New NotesSession
Dim ws As New NotesUIWorkspace
Dim thisDb As NotesDatabase
Dim uidoc As NotesUIDocument
Dim thisDoc As NotesDocument
Dim dialogDoc As NotesDocument
Dim continue As Variant
Set uidoc = ws.CurrentDocument
Set thisDb = s.CurrentDatabase
Set thisDoc = uidoc.Document
Set dialogDoc = thisDb.CreateDocument
dialogDoc.InstructionText = "Put your user instructions here"
dialogDoc.UserInput = thisDoc.FieldA
continue = ws.Dialogbox("DialogForm",True,True,False,False,False,False,"Title For Dialog Box",dialogDoc,True,False,True)
If continue Then
thisDoc.FieldA = dialogDoc.UserInput
If uidoc.EditMode = False Then
Call thisDoc.Save(True,False)
End If
End If
End Sub
'--------------------------------------
可以使用這個範例。
'-------------------------
Sub Click(Source As Button)
Dim s As New NotesSession
Dim ws As New NotesUIWorkspace
Dim thisDb As NotesDatabase
Dim uidoc As NotesUIDocument
Dim thisDoc As NotesDocument
Dim dialogDoc As NotesDocument
Dim continue As Variant
Set uidoc = ws.CurrentDocument
Set thisDb = s.CurrentDatabase
Set thisDoc = uidoc.Document
Set dialogDoc = thisDb.CreateDocument
dialogDoc.InstructionText = "Put your user instructions here"
dialogDoc.UserInput = thisDoc.FieldA
continue = ws.Dialogbox("DialogForm",True,True,False,False,False,False,"Title For Dialog Box",dialogDoc,True,False,True)
If continue Then
thisDoc.FieldA = dialogDoc.UserInput
If uidoc.EditMode = False Then
Call thisDoc.Save(True,False)
End If
End If
End Sub
'--------------------------------------
2008年3月6日 星期四
02.在Lotus視界中的文件若要在Diablog中顯示可用以下範例。
在視界(View)中的Sub Queryopendocument(Source As Notesuiview, Continue As Variant)中使用。
'------------------------------------------------------------
Call ws.dialogbox("TheForm", True, True, False, True, False, False, "TheTitle", source.documents.getfirstdocument)
若要儲存開啟中的文件可以使用『button』公式如下:
@Command([FileSave])
P.S.: When calling the dialogbox using
Then you can make your button to execute
@Command([FileSave]);
@Command([FileCloseWindow])
to save and close the dialogbox.
'-------------------------------------------
Dim ws As New NotesUIWorkspace
Dim sess As New NotesSession
Dim db As NotesDatabase '目前資料庫
Dim doc As NotesDocument '選取文件
Dim fdb As NotesDatabase '要開啟視界的資料庫
Dim fview As NotesView '要開啟的視界
Set db = ws.CurrentDatabase.Database
Set doc = db.GetDocumentByID(Source.CaretNoteID)
Set fview=db.GetView("scheduleevent")
Call ws.DialogBox _
( "scheduleevent", True, True, True, True, _
False, False, "scheduleevent")
Continue = False
'------------------------------------
當『視界』是以『嵌入視界』的型態,那麼就要使用以下語法範例才可以將文件開啟在DialogBox中'------------------------------------------------------------
Call ws.dialogbox("TheForm", True, True, False, True, False, False, "TheTitle", source.documents.getfirstdocument)
若要儲存開啟中的文件可以使用『button』公式如下:
@Command([FileSave])
P.S.: When calling the dialogbox using
Call ws.dialogbox("TheForm", True, True, True, True, False, False, "TheTitle", source.documents.getfirstdocument, False, True)
it displays no "OK" or "Cancel" button.Then you can make your button to execute
@Command([FileSave]);
@Command([FileCloseWindow])
to save and close the dialogbox.
訂閱:
文章 (Atom)