Subject: RE: Auto config Calendar profile!
hiI don’t get any errors!
Some of our users have not enabled “automatic responses to meeting invitations” in the calendar profile document i the mail database.
Now we want to use the agent to set some defaults in the calendar profile without the users knowing. so the agent runs once a week to set the fields in the calendar profile the way we want (administrators).
Lets say the user have not enable the autoprocess. this means the then I book a meeting i his calendar it is not booked in the calendar right away (the user must accept in inbox). Now I run my agent (server side so it has manager rights to the mail file). Then I test again and the meeting still gets in the inbox. then I open the calendar profile in the users mail file. I can see that all the fields is set right the way I want.?? then I save the profile document and test again. Now the meeting gets booked in the calendar automatic.
Here is the script:
Dim ns As New NotesSession
Dim nDBCur As NotesDatabase
Dim nDBNAB As NotesDatabase
Dim nViewNAB As NotesView
Dim nColNAB As NotesDocumentCollection
Dim nDocNAB As NotesDocument
Dim nDBMail As NotesDatabase
Dim nDocPre As NotesDocument
Dim sMailServer As String
Dim sMailDatabase As String
On Error Goto errorhandler
Set nDBCur = ns.CurrentDatabase
Set nDBNAB = ns.GetDatabase(“dkny1”,“names.nsf”)
Set nViewNAB = nDBNAB.GetView(“($Company)”)
Set nColNAB = nViewNAB.GetAllDocumentsByKey(“IBS DK”,True)
Set nDocNAB = nColNAB.GetFirstDocument
While Not nDocNAB Is Nothing
sMailServer = nDocNAB.MailServer(0)
sMailDatabase = nDocNAB.MailFile(0)
Set nDBMail = ns.GetDatabase(sMailServer,sMailDatabase)
Set nDocPre = nDBMail.GetProfileDocument(“CalendarProfile”)
Call nDocPre.ReplaceItemValue(“$DialogMode”,Cint(“0”))
'//AutoProcess Calendar entries
nDocPre.AutoProcessConflictOptions = “1”
nDocPre.AutoProcessForwardTo = “”
nDocPre.AutoProcessFromType = “0”
nDocPre.AutoProcessMeetings = “1”
nDocPre.AutoProcessType = “0”
nDocPre.AutoProcessUserList = “”
nDocPre.AutoRemoveFromInbox = “1”
nDocPre.DeleteCSPref = “2”
Call nDocPre.RemoveItem(“AutoProcessTypeDisabled”)
Call nDocPre.RemoveItem(“tmpAutoProcessEnabled”)
Call nDocPre.RemoveItem(“tmpAutoProcessAction”)
'Call nDocPre.ComputeWithForm( False, False )
Flag = nDocPre.Save(True,True,True)
Set nDocNAB = nColNAB.GetNextDocument(nDocNAB)
Wend
Print “done”
Exit Sub
errorhandler:
Print "Fejl: "+Error()
Exit Sub