I want to create a JS script to list all the mails in the Inbox. As I can't use com object in Python on my workstation. But it failed to get value of "from" while VBS can do the job. I don't have enough time to investigate the root cause, just leave it here for later reference.
'VB script Set objNotesSession = CreateObject("Lotus.NotesSession") objNotesSession.Initialize(pwd) Set objNotesMailFile = objNotesSession.GetDatabase(server, database file) Set view = objNotesMailFile.GetView("($Inbox)") Set doc = view.GetFirstDocument While Not ( doc Is Nothing ) WScript.Echo doc.GetItemValue( "From" )(0) Set doc = view.GetNextDocument( doc ) Wend
//JavaScript var s = new ActiveXObject("Lotus.NotesSession"); s.Initialize(pwd); var db = s.GetDatabase(server, database file); var v = db.GetView("($Inbox)") var doc = v.GetFirstDocument(); while (doc) { WScript.Echo( doc.LastAccessed ); doc = v.GetNextDocument(doc); }
No comments:
Post a Comment