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
'--------------------------------------

沒有留言: