par Oguruma59 » 14 Jan 2004 à 11:08
Synopsis de base de documents Lotus Notes - créé à 10:56:32 le 14/01/2004Informations de bibliothèque de codesNom : ClassMailDernière modification : 13/01/2004 23:36:21Code LotusScript :Option PublicPublic Class Mail Private MailSession As NotesSession Private MailDB As NotesDataBase Private MailDoc As NotesDocument Private RTBody As Variant Private RS As Variant Private ItemSendTo As NotesItem Private ItemCopyTo As NotesItem Private ItemBlindCopyTo As NotesItem Public Sub new Set MailSession=New NotesSession Set MailDB = MailSession.CurrentDataBase Set MailDoc=New NotesDocument(MailDB) Set RTBody = MailDoc.CreateRichTextItem( "Body" ) Set RS=MailSession.CreateRichTextStyle MailDoc.Form="Memo" End Sub Public Sub SetRecipients(SendTo As Variant, CopyTo As Variant, BlindCopyTo As Variant) Set ItemSendTo = New NotesItem( MailDoc, "SendTo", SendTo ) Set ItemCopyTo = New NotesItem( MailDoc, "CopyTo", CopyTo ) Set ItemBlindCopyTo = New NotesItem( MailDoc, "CopyTo", BlindCopyTo ) End Sub Public Property Set Subject As String MailDoc.Subject=Subject End Property Public Property Set ReturnReceipt As Integer MailDoc.ReturnReceipt=ReturnReceipt End Property Public Sub SetBody(Body As Variant) If Isarray(Body) Then Forall T In Body Call RTBody.AppendText( T ) Call RTBody.AddNewLine(1) End Forall Else Call RTBody.AppendText( Body ) Call RTBody.AddNewLine(1) End If End Sub Public Sub SetDocLink(Msg As String,DocLink As NotesDocument) Call RTBody.AddNewLine(1) Call RTBody.AppendText( Msg ) Call RTBody.AppendDocLink( DocLink, MailDoc.Subject(0)) End Sub Public Sub SetDocLinkDB(Msg As String,DocLink As NotesDataBase) Call RTBody.AddNewLine(1) Call RTBody.AppendText( Msg ) Call RTBody.AppendDocLink( DocLink, MailDoc.Subject(0)) End Sub Public Sub SetAttachement(F As Variant) If Isarray(F) Then Forall Attached In F Call RTBody.EmbedObject( EMBED_ATTACHMENT, "", Attached) End Forall Else Call RTBody.EmbedObject( EMBED_ATTACHMENT, "", F) End If End Sub Public Property Set Principal As String MailDoc.Principal=Principal End Property Public Property Set ReplyTo As String MailDoc.ReplyTo=ReplyTo End Property Public Sub SetColor(Color As Variant) RS.NotesColor=Color Call RTBody.AppendStyle(RS) End Sub Public Sub SetBold(isBold As Integer) RS.Bold=isBold Call RTBody.AppendStyle(RS) End Sub Public Sub SetItalic(isItalic As Integer) RS.Italic=isItalic Call RTBody.AppendStyle(RS) End Sub Public Sub Send(isSave) Call MailDoc.Send( isSave ) End Sub Public Sub Delete Set MailDoc=Nothing Set MailSession=Nothing Set MailDB=Nothing Set RTBody=Nothing Set RS=Nothing End Sub End Class