Sub Click(Source As Button)
Dim session As New NotesSession
Dim Database As NotesDatabase
Dim current As NotesDatabase
Dim mailbox As New NotesDatabase("","")
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim maildoc As NotesDocument
Dim doc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim item As Variant
Dim item_body As notesItem
Dim item_sub As Variant
Dim item_bodys As Variant
Dim sendas As String
sendas = "ivan.hunkeler@ksl.ch"
' Setzen der aktuellen E-Mail-Adresse des Users
' Dim useremail As Variant
' useremail = uidoc.FieldGetText( "HelpdeskSendTo" )
' sendas = useremail(0)
' get handle to mail.box on the users current mail server
Set Database = session.CurrentDatabase
' Aktuelles Dokument
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.document
' Create a new document in the severs mail box
Set maildoc = New Notesdocument(Database)
maildoc.Form = "Memo"
maildoc.From = sendas
maildoc.SendFrom = sendas
' maildoc.SendTo = sendto
item = uidoc.FieldGetText( "HelpdeskSendTo" )
Call maildoc.ReplaceItemValue( "SendTo", item )
' maildoc.Recipients = sendto
Call maildoc.ReplaceItemValue( "recipients", item )
' maildoc.Subject = subject
item_sub = uidoc.FieldGetText( "HelpdeskMailSubject" )
Call maildoc.ReplaceItemValue( "Subject", item_sub )
' maildoc.MailBody= Mailbody
' item_bodys = uidoc.FieldGetText( "MailBody" )
' Call maildoc.ReplaceItemValue( "Body", item_bodys )
' Call rtitem.AppendText("item_bodys")
maildoc.Body = uidoc.FieldGetText("MailBody")
' uidoc.GotoField("MailBody")
' uidoc.SelectAll
' uidoc.Copy
' uidoc.GotoField("Body")
' uidoc.Paste
' Body-Feld
Dim rtitemA As Variant
Dim rtitemB As Variant
Call doc.Save( True, False )
Call uidoc.Save
Set rtitemA = doc.GetFirstItem( "MailBody" )
Set rtitemB = New NotesRichTextItem (maildoc, "MailBody")
Call rtitemB.AppendRTItem( rtitemA )
maildoc.PostedDate = Now()
maildoc.ComposedDate = Now()
maildoc.DeliveredDate = Now()
maildoc.Principal = sendas
maildoc.EncryptOnSend = False
Call maildoc.Save( True, False )
Call maildoc.Send(False )
End Sub
soweit soo gut... das funktioniert... danke für eure Bemühungen...
nun wäre ich noch über einen Tipp glücklich;-)
...ich lesse ja das RichTextfeld so aus * maildoc.Body = uidoc.FieldGetText("MailBody") *
...gibt es eine andere, bessere möglichkeit?! bei der dir Formatierung vom RichTextFeld ins Mail übernommen wird?! Mir werden soo keine Zeilenumbrüche mitgeliefert...
danke und schönen tag noch
greeeetz ivan