以下程式碼經測試可以使用..
------------------------------------
'Create new doc for dialog box
Dim s As New Notessession
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim docCustom As NotesDocument
Set s = New Notessession
Set w = New NotesUIWorkspace
Set uidoc=w.CurrentDocument
Set db = s.CurrentDatabase
Set docCustom = db.CreateDocument
docCustom.form="scheduleevent"
'Set Fields (Default)
' docCustom.Field1 = ""
' docCustom.Fiels2 = ""
docCustom.sitecode =uidoc.FieldGetText("sitecode")
docCustom.socode =uidoc.FieldGetText("socode")
docCustom.rescode = ""
docCustom.resname = ""
docCustom.seworkday = ""
docCustom.sestartdate = ""
docCustom.sefinishdate = ""
docCustom.serate = ""
docCustom.semoney = ""
'Display Dialog to allow users to Fill Field
' (dlgCustom) is the form
x = w.Dialogbox("scheduleevent", True, True, False, False, False, False, _
"Fill Fields ",docCustom,False,False)
If x = False Then Exit Sub
' ....
Call docCustom.Save(True, True)
沒有留言:
張貼留言