O
Olga23
Ljudi dobrie, pomogite pogalujsta. U menya v History dokumenta nado sohranit, kto i kogda nagal pereslat etot dokumnet drugomu, t.e. sohranit imya cheloveka, kto poslal i datu-kogda. Est 2 polya, v kotorih kak raz i hranitsya eta infa:
forwarded_by -eto pole, gde hranitsya imya cheloveka(pole tipa avtori)
forwarded_at-eto data(pole tipa data)
Seychas u menya vse eto sohranyaetsya, vot kod dejstvija pereslat drugomu:
Sub Click(Source As Button)
Dim wks As New NotesUIWorkspace
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim mdoc As NotesDocument
Dim rt As NotesRichTextItem
Dim nam As NotesName
Dim session As New NotesSession
Dim item As NotesItem
Set db=wks.CurrentDatabase.Database
Set doc=wks.CurrentDocument.Document
Set nam = New NotesName(session.UserName)
doc.forwarded_by=nam.Common
doc.forwarded_at=Now
doc.Save True,True
Set mdoc=db.CreateDocument
Dim tdoc As NotesDocument
Set tdoc=db.CreateDocument
Call doc.CopyAllItems(tdoc,False)
tdoc.form="NotizMemo"
Set rt=mdoc.CreateRichTextItem("Body")
Call tdoc.RenderToRTItem(rt)
mdoc.form="Memo"
Call mdoc.Save(True,False)
Call wks.EditDocument(True,mdoc,False)
Dim uidoc As NotesUIDocument
Set uidoc = wks.CurrentDocument
Call uidoc.forward
uidoc.Close
End Sub
Forma NotizMemo-eto forma, gde hranyatsya kopii poley formi originala, iz kotoroj vizivaem eto deystvie(tam hranyatsya ne vse polya)
Forma memo- eto forma, sodergaschaya odno pole"Body", rabota s kotorim proishodit v etoj chasti koda:
Set rt=mdoc.CreateRichTextItem("Body")
Call tdoc.RenderToRTItem(rt)
mdoc.form="Memo"
Pri vsem etom kode, sohranyaetsya Imya i data v History, no esli kto-to novij nagmet eto deystvie i poshlet drugomu, to v History uge budet otobragatsya etot novij chelovek, starij udalyaetsya...Tak vot mne bi hotelos sprosit, kak ispolzovat
AppendToTextList, chtobi bila vozmognost dobavleniya novogo polzovatelya, bez zatiranija starogo.I kak organizovat rabotu AppendToTextList s Datoj?Ved eta funkzija rabotaet tolko s String...
I eshe hotelos bi sprosit, mne nado,chtobi tolko poslednii 10 polzovateleybili pokazani, kto polzovalsya etim deystviem pereslat drugomu...Kak napisat etu obrabotku, chto proveryat?Zavodit massiv iz etih ljudey i schitat ili?
Pogalujsta pomogite....
forwarded_by -eto pole, gde hranitsya imya cheloveka(pole tipa avtori)
forwarded_at-eto data(pole tipa data)
Seychas u menya vse eto sohranyaetsya, vot kod dejstvija pereslat drugomu:
Sub Click(Source As Button)
Dim wks As New NotesUIWorkspace
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim mdoc As NotesDocument
Dim rt As NotesRichTextItem
Dim nam As NotesName
Dim session As New NotesSession
Dim item As NotesItem
Set db=wks.CurrentDatabase.Database
Set doc=wks.CurrentDocument.Document
Set nam = New NotesName(session.UserName)
doc.forwarded_by=nam.Common
doc.forwarded_at=Now
doc.Save True,True
Set mdoc=db.CreateDocument
Dim tdoc As NotesDocument
Set tdoc=db.CreateDocument
Call doc.CopyAllItems(tdoc,False)
tdoc.form="NotizMemo"
Set rt=mdoc.CreateRichTextItem("Body")
Call tdoc.RenderToRTItem(rt)
mdoc.form="Memo"
Call mdoc.Save(True,False)
Call wks.EditDocument(True,mdoc,False)
Dim uidoc As NotesUIDocument
Set uidoc = wks.CurrentDocument
Call uidoc.forward
uidoc.Close
End Sub
Forma NotizMemo-eto forma, gde hranyatsya kopii poley formi originala, iz kotoroj vizivaem eto deystvie(tam hranyatsya ne vse polya)
Forma memo- eto forma, sodergaschaya odno pole"Body", rabota s kotorim proishodit v etoj chasti koda:
Set rt=mdoc.CreateRichTextItem("Body")
Call tdoc.RenderToRTItem(rt)
mdoc.form="Memo"
Pri vsem etom kode, sohranyaetsya Imya i data v History, no esli kto-to novij nagmet eto deystvie i poshlet drugomu, to v History uge budet otobragatsya etot novij chelovek, starij udalyaetsya...Tak vot mne bi hotelos sprosit, kak ispolzovat
AppendToTextList, chtobi bila vozmognost dobavleniya novogo polzovatelya, bez zatiranija starogo.I kak organizovat rabotu AppendToTextList s Datoj?Ved eta funkzija rabotaet tolko s String...
I eshe hotelos bi sprosit, mne nado,chtobi tolko poslednii 10 polzovateleybili pokazani, kto polzovalsya etim deystviem pereslat drugomu...Kak napisat etu obrabotku, chto proveryat?Zavodit massiv iz etih ljudey i schitat ili?
Pogalujsta pomogite....