Hi There
Please Help me, I’m getting so close to getting the Added To value in a collection of docs, and
now have a type mismatch on line :
Set AddedDate in script below :
Here’s what I have in Initialise :
Dim view As NotesView
Dim AddedDate As NotesDateTime
Set view = db.GetView("All Docs")
Set doc = view.getfirstdocument()
Do While Not doc Is Nothing
Set AddedDate = New NotesDateTime(AddedToFile(doc))
Call doc.ReplaceItemValue("AddedToFile", AddedDate)
Call doc.Save(True, False)
Set doc = view.getnextdocument(doc)
Loop
I have already added the API Function from the forum to the decalrations. Just above bug to sort above.
Appreciate your help - Many Thanks,
Sue Gardner
Subject: REF : Getting Added To Value from Docs-Nearly There Please Help
Hi Sue,
first of all i’m not sure about the format of your function “AddedToFile(doc)” - i suppose, it is the correct format for a date string…
I think, the error lies in the next line:
Call doc.ReplaceItemValue(“AddedToFile”, AddedDate)
Here you are trying to use an object (i.e. the NotesDateTime structure) as a value + naturally that doesn’t work…
Try something like:
Call doc.ReplaceItemValue(“AddedToFile”, AddedDate.DateOnly)
or
Call doc.ReplaceItemValue(“AddedToFile”, AddedDate.LocalTime)
I hope this helps…
Greetings
Andreas Ohlendorf
PS: English is not my native language so pls. excuse any mistakes 
Subject: REF : Gatting Added To Value from Docs-Nearly There Please Help
It is pointless using a NotesDateTime object. You can simply write:doc.AddedToFile = Cdat(AddedToFile(doc))
This assumes that the AddedToFile function has actually worked and returned a string. Did you check its returned value in the debugger?