Menu

The greatest tool for all Notes developers

Tom Demuyt
2004-11-01
2013-02-27
  • Tom Demuyt

    Tom Demuyt - 2004-11-01

    Messing up values in documents is the bread and butter of any developer that has to clean up someone else's mess.

    If you are interested , but you dont know how to set this one up, contact me.

    Sub Initialize
        Dim session As New NotesSession
        Dim db As NotesDatabase
        Dim collection As NotesDocumentCollection
        Dim doc As NotesDocument
        Dim item As NotesItem
       
        Set db = session.CurrentDatabase
        Set collection = db.UnprocessedDocuments
       
        fieldname = Inputbox("Name of Field?")
        fieldtype = Inputbox("Data type : <default> , D, T , DT")
        fieldvalue = ""
        If fieldtype = "D" Or fieldtype = "d" Then
            fieldvalue = Inputbox( "New value , mm/dd/yyyy" )
            fieldvalue = Cdat( fieldvalue )
        End If
        If fieldtype = "T" Or fieldtype = "t" Then
            fieldvalue = Inputbox( "New value , hh:mm" )
            fieldvalue =Timevalue( fieldvalue )
        End If
        If fieldtype = "" Then
            fieldvalue = Inputbox( "New value")
        End If
        If fieldtype = "dt" Or fieldtype = "DT" Then
            pday = Inputbox("day")
            pmonth = Inputbox("month")
            pyear = Inputbox("year")
            phour = Inputbox("hour")   
            pminutes = Inputbox("minutes")
            pseconds = Inputbox("seconds")
            ptime = Timenumber(  phour , pminutes ,  pseconds  )   
            pdate = Datenumber(  pyear , pmonth , pday )
            fieldvalue = ptime + pdate   
        End If
       
        For i = 1 To collection.Count
            Set doc = collection.GetNthDocument( i )       
            Set item = doc.ReplaceItemValue( fieldname , fieldvalue )
            b = doc.save( True , True )
        Next
    End Sub

     
    • Tom Demuyt

      Tom Demuyt - 2004-11-01

      Yes,

      I tend to exaggerate my subjects,
      so Google buzz off ;D

      T.

       

Log in to post a comment.

MongoDB Logo MongoDB