Manage Learn to apply best practices and optimize your operations.

Microsoft Project and Lotus Notes

Integrate MP and Lotus via COM two diferent technologies working together.
Public OLEHandle As Variant
Public boolembedded As Boolean
Public doc As NotesDocument
Public app As Application

Sub anexaradominoSUB()

Dim db As NotesDatabase
Dim nab As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument

Dim stds As Variant
Dim tf As Variant
Dim ses As New NotesSession
Dim elid

 ses.Initialize


 Set db = ses.GetDatabase("server", "database")
 
 On Error GoTo errorhandler

If ActiveProject.Path = "" Then
MsgBox ("Debe guardar el proyecto")

End If

Dim R As Long, Names As String
Dim Temp As Long, A As Assignment

num_act = 0
nu_tar = 1

For Temp = 1 To ActiveProject.Tasks.Count
    TaskName = ActiveProject.Tasks(Temp).Name
    
    
    fecha = ActiveProject.Tasks(Temp).GetField(pjTaskStart)
    tama = Len(fecha)
    fe_ini = Mid(fecha, 3, tama)
    dura = ActiveProject.Tasks(Temp).GetField(pjTaskDuration)
    recurso = ActiveProject.Tasks(Temp).GetField(pjTaskResourceNames)
    nivel = ActiveProject.Tasks(Temp).OutlineLevel
    
    
    
    If nivel = 2 Then
      num_act = num_act + 1
      Set doc = db.CreateDocument
      Call doc.ReplaceItemValue("Form", "Actividades")
      Call doc.ReplaceItemValue("nu_act", CStr(num_act))
      Call doc.ReplaceItemValue("nom_act", TaskName)
      Call doc.ReplaceItemValue("fe_ini", fe_ini)
      
      Call doc.ComputeWithForm(False, False)
      Call doc.Save(True, False)
      elid = doc.UniversalID
      
      ActivActu = TaskName
      
    End If
    
    If nivel = 3 Then
      Set doc = db.CreateDocument
      Call doc.ReplaceItemValue("Form", "Tareas")
      Call doc.ReplaceItemValue("nu_act", CStr(num_act))
      Call doc.ReplaceItemValue("nom_act", ActivActu)
      
      If ActivAant = ActivActu Then
      nu_tar = nu_tar + 1
      Else
      nu_tar = 1
      End If
      Call doc.ReplaceItemValue("nom_tar_c", CDbl(0))
      Call doc.ReplaceItemValue("nu_tar", CStr(nu_tar))
      Call doc.ReplaceItemValue("nom_tar", TaskName)
      Call doc.ReplaceItemValue("fe_ini", fe_ini)
      Call doc.ReplaceItemValue("dura", dura)
      Call doc.ReplaceItemValue("nom_rec", recurso)
      Call doc.ReplaceItemValue("por_com", "0")
            
      Call doc.ComputeWithForm(False, False)
      Call doc.Save(True, False)
      Rem elid = doc.UniversalID
      
      
      ActivAant = ActivActu
    End If
    
    
Next Temp
    

errorhandler:
If Err = ERR_NOTES_SESSION_NOT_INIT Then
ses.Initialize
Resume Next
Else
MsgBox ("Run time errror" & Str(Err) & ": " & vbCr & Err.Description)
End If

End Sub

Dig Deeper on Lotus Notes 8

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close