I got this sample from sandbox, but upon clicking, only MS project is running. What was it supposed to do? I just like to know what is the feature it tried to show, tq.
Sub Click(Source As Button)
Dim hwd
Dim diagram
Dim topnode
Dim commSession As NotesSession
Dim commServer As String
Dim commCurrentDatabase As NotesDatabase
Dim commCurrentDocument As NotesDocument
Dim commWorkspace As NotesUIWorkspace
Dim commcollection As NotesDocumentCollection
Dim count As Integer
Dim sessionid As String
Dim sessiontitle As String
Dim profile As notesdocument
Dim taskdb As NotesDatabase
Dim ws As New notesuiworkspace
Dim db As notesdatabase
Dim docnav As notesViewNavigator
Dim doc As notesdocument
Dim projectdoc As notesdocument
Dim selecteddocs As notesdocumentcollection
Dim view As notesview
Dim loopdoc As notesviewentry
Dim assignedto As NotesName
Dim msproject As Variant
Dim viewname As String
Dim projidcount As Integer
Dim lastdocument As String
Set commSession = New NotesSession
Set commCurrentDatabase = commSession.CurrentDatabase
Set commWorkspace= New NotesUIWorkspace
Set profile = commCurrentDatabase.GetProfileDocument("profileDatabaseSetup")
Set taskdb = commSession.GetDatabase("", profile.mailfile(0))
sessionid = profile.sessionnumber(0)
sessiontitle = profile.sessionevent(0) & " - " & profile.sessionname(0)
viewname = "TodoByStatus"
Set view = taskdb.GetView ( viewName )
If view Is Nothing Then
Msgbox "Folder Not Located"
Exit Sub
End If
Set msproject = createobject("msproject.application")
msproject.visible = True
Call msproject.filenew(False, "", False, False)
Call msproject.displayalerts(False)
Set docnav = view.CreateViewNav
projidcount = 1
Set loopentry = docnav.GetFirstDocument
Do Until (loopentry Is Nothing)
Set doc = loopentry.document
Call doc.ReplaceItemValue("MSProjID", Cstr(projidcount))
Call doc.save(True,False)
Call msproject.settaskfield("Name", doc.subject(0), False, True, projidcount)
Call msproject.settaskfield("Duration", projidcount, False, True, projidcount)
Call msproject.settaskfield("Start", doc.StartDate(0), False, True, projidcount)
Call msproject.settaskfield("Finish", doc.DueDate(0), False, True, projidcount)
Call msproject.settaskfield("Estimated", "No", False, True, projidcount)
Call msproject.settaskfield("Text1", doc.noteID, False, True, projidcount)
Set assignedto = New NotesName( doc.principal(0) )
Call msproject.settaskfield("Resource Names", assignedto.Common, False, True, projidcount)
Call msproject.selectrow(projidcount, False, 1)
projidcount = projidcount + 1
Set loopentry = docnav.GetNextDocument(loopentry)
Loop
projidcount = 1
End Sub