Изменение статусов в Todo

  • Автор темы deimos
  • Дата начала
D

deimos

Гость
#1
Всем привет!
Отправляю письмо-задачу адресату. Программно определяю статус задачи в зависимости от заданного времени "StartDateTime" (Not started, Current ....). Адресату задача приходит...все в принципе ок...Но при наступлении времени изменения статуса, к примеру задача просрочена, он не меняется! Помогите плиз!



<!--shcode--><pre><code class='vb.net'> objNotesItem = objNotesDocument.ReplaceItemValue("Form", "Task")
objNotesItem = objNotesDocument.ReplaceItemValue("From", objNotesSession.UserName)
objNotesItem = objNotesDocument.ReplaceItemValue("Owner", objNotesSession.UserName)
objNotesItem = objNotesDocument.ReplaceItemValue("Send to", pSendTo)
objNotesItem = objNotesDocument.ReplaceItemValue("Subject", pSubject)
objNotesItem = objNotesDocument.ReplaceItemValue("AssignedTo", pSendTo)
objNotesItem = objNotesDocument.ReplaceItemValue("Chair", objNotesSession.UserName)
objNotesItem = objNotesDocument.ReplaceItemValue("Principal", objNotesSession.UserName)
objNotesItem = objNotesDocument.ReplaceItemValue("$BusyName", objNotesSession.UserName)
objNotesItem = objNotesDocument.ReplaceItemValue("$BusyPriority", "2")
objNotesItem = objNotesDocument.ReplaceItemValue("Recipients", pSendTo)

objNotesItem.IsNames = True
objNotesItem.IsAuthors = True


objNotesItem = objNotesDocument.ReplaceItemValue("DueDate", pDateDue)
objNotesItem = objNotesDocument.ReplaceItemValue("DueDateTime", pDateDue)

If pDateStart > Now() Then
objNotesItem = objNotesDocument.ReplaceItemValue("DueState", 2)
'ElseIf pDateStart < Now() Then
'error
ElseIf pDateDue < Now() Then
objNotesItem = objNotesDocument.ReplaceItemValue("DueState", 0)
ElseIf pDateStart < Now() And pDateDue > Now() Then
objNotesItem = objNotesDocument.ReplaceItemValue("DueState", 1)
Else
'error
End If


objNotesItem = objNotesDocument.ReplaceItemValue("$NoPurge", pDateStart)
objNotesItem = objNotesDocument.ReplaceItemValue("PostedDate", pDateDue)
'objNotesItem = objNotesDocument.ReplaceItemValue("AppendStartTime", pDateDue)
objNotesItem = objNotesDocument.ReplaceItemValue("StartDateTime", pDateStart)
objNotesItem = objNotesDocument.ReplaceItemValue("StartDate", pDateStart)
objNotesItem = objNotesDocument.ReplaceItemValue("EndDateTime", pDateDue)
objNotesItem = objNotesDocument.ReplaceItemValue("EndDate", pDateDue)
objNotesItem = objNotesDocument.ReplaceItemValue("EndTime", pDateDue)

objNotesItem = objNotesDocument.ReplaceItemValue("$CSVersion", "2")
objNotesItem = objNotesDocument.ReplaceItemValue("$ExpandGroups", "3")
objNotesItem = objNotesDocument.ReplaceItemValue("$HFFlags", "1")
objNotesItem = objNotesDocument.ReplaceItemValue("$Encrypt", "0")
objNotesItem = objNotesDocument.ReplaceItemValue("SequenceNum", 1)
objNotesItem = objNotesDocument.ReplaceItemValue("UpdateSeq", 1)
objNotesItem = objNotesDocument.ReplaceItemValue("WebDateTimeInit", "1")


objNotesItem = objNotesDocument.ReplaceItemValue("AppointmentType", "2")
objNotesItem = objNotesDocument.ReplaceItemValue("CalendarDateTime", pDateStart)
objNotesItem = objNotesDocument.ReplaceItemValue("Repeats", "1")
objNotesItem = objNotesDocument.ReplaceItemValue("alarmDescription", "test alarm")
objNotesItem = objNotesDocument.ReplaceItemValue("Alarms", "1")
objNotesItem = objNotesDocument.ReplaceItemValue("$Alarm", 1)
objNotesItem = objNotesDocument.ReplaceItemValue("$AlarmOffset", -10)
objNotesItem = objNotesDocument.ReplaceItemValue("$AlarmUnit", "M")


objNotesItem = objNotesDocument.ReplaceItemValue("Importance", pPriority)
objNotesItem = objNotesDocument.ReplaceItemValue("TaskType", "1")
objNotesItem = objNotesDocument.ReplaceItemValue("Categories", "C")
objNotesItem = objNotesDocument.ReplaceItemValue("AssignState", "2")

objNotesItem = objNotesDocument.ReplaceItemValue("DefaultMailSaveOptions", "1")
objNotesItem = objNotesDocument.ReplaceItemValue("MailOptions", "0")
objNotesItem = objNotesDocument.ReplaceItemValue("StorageRequiredNames", "1")
objNotesItem = objNotesDocument.ReplaceItemValue("_ViewIcon", 168)
objNotesItem = objNotesDocument.ReplaceItemValue("$SMTPKeepNotesItems", "1")
objNotesItem = objNotesDocument.ReplaceItemValue("$MessageID", "")
objNotesItem = objNotesDocument.ReplaceItemValue("$PublicAccess", "1")
objNotesItem = objNotesDocument.ReplaceItemValue("apptUNID", objNotesDocument.UniversalID)
objNotesItem = objNotesDocument.ReplaceItemValue("Location", "")
objNotesItem = objNotesDocument.ReplaceItemValue("$Mailer", "Lotus Notes Release 8.5.1 September 28, 2009")
objNotesItem = objNotesDocument.ReplaceItemValue("INetRequiredNames", ".")
objNotesItem = objNotesDocument.ReplaceItemValue("MiniView", "1")
objNotesItem = objNotesDocument.ReplaceItemValue("MsgTaskFlags", "0")


'Create and set the Body content
If pAttachFile.Length > 0 Then
objNotesRishTextItem = objNotesDocument.CreateRichTextItem("Description")
objNotesRishTextItem.AppendText(pBody & Environment.NewLine & Environment.NewLine)
'Domino.EMBED_TYPE.EMBED_ATTACHMENT = 1454, pAttachFile - Attachment Path
objNotesRishTextItem.EmbedObject(Domino.EMBED_TYPE.EMBED_ATTACHMENT, "", pAttachFile)
'Example to save the message (optional)
objNotesDocument.SaveMessageOnSend = True
End If


'objNotesDocument.ReplaceItemValue("PostedDate", Now())
If objNotesDocument.Save(True, True, True) Then
objNotesDocument.Send(False, CType(pSendTo, Object))
objNotesDocument.PutInFolder("$Alarms")
End If[/CODE]
 
D

deimos

Гость
#2
PS: Включение опции "Allow Notes to udate To Do status and dates for incomplete entries" не помогает!