Autor Thema: Mail an Dokument hängen  (Gelesen 1331 mal)

Offline gere

  • Aktives Mitglied
  • ***
  • Beiträge: 216
  • Geschlecht: Männlich
Mail an Dokument hängen
« am: 12.07.05 - 14:51:49 »
Hallo zusammen,

Wie in aller Welt kann man eine Email aus $Inbox in ein RichTextField in einer Notes-Datenbank anhängen?  ???
Das Prinzip soll so funktionieren wie mit der Büroklammer und Dateianhängen. Ich erstelle eine Aktion, die den Posteingang öffnet, dort wähle ich eine Email aus, kopiere den Content und füge ihn in ein RichTextFeld in einer Datenbank. Das MailTemplate sollte dabei natürlich nicht verändert werden.

Hat sowas schon mal jemand realisiert?

Vielen dank, das würde mich enorm weiterbringen.

Gruß Gere

klaussal

  • Gast
Re: Mail an Dokument hängen
« Antwort #1 am: 12.07.05 - 15:12:57 »
So ähnlich:
Code
Sub Initialize
Dim ws As New NotesUIWorkspace
Dim session As New NotesSession
Dim doc As NotesDocument
Dim uidoc As NotesUIDocument
Dim docNew As NotesDocument
Dim view As NotesView
Dim dc As NotesDocumentCollection
Dim db As NotesDatabase
Dim strDBName As String
Dim collection As NotesDocumentCollection
Dim docColl As NotesDocument
Dim intI As Integer
Dim strServer As String
Dim strView As String
Dim strMail As String
Dim rtitemA As Variant
Dim rtitemB As Variant
Dim varDummy As Variant
Dim richStyle As NotesRichTextStyle
'Set uidoc = ws.currentDocument
Set richStyle = session.CreateRichTextStyle
strMail= session.GetEnvironmentString( "MailFile"  , True)
strView = "$Inbox"
strServer = "Servername"
strDBName = strMail
'Set doc = uidoc.document
Set db = session.CurrentDatabase
Set collection = ws.PickListCollection( PICKLIST_CUSTOM, True, strServer, strDBName, strView, "Mailauswahl", "Bitte wählen Sie eine Mail aus")
If collection Is Nothing Then
Msgbox "gecancelt"
Else
Set docColl = collection.GetFirstDocument
If docColl Is Nothing Then
Exit Sub
Else
Do While Not docColl Is Nothing
Set docNew = db.createDocument
docNew.form = "Topic1"
Set rtitem = New NotesRichTextItem( docNew, "DawText" )
richStyle.Bold = True
Call rtitem.AppendStyle(richStyle)
Call rtitem.AppendText( "Absender" )
Call rtitem.AddNewLine( 1 )
Call rtitem.AppendText( docColl.from(0) )
Call rtitem.AddNewLine( 1 )
Call rtitem.AppendText( "Datum" )
Call rtitem.AddNewLine( 1 )
If docColl.HasItem( "DeliveredDate" ) Then
Call rtitem.AppendText( docColl.DeliveredDate(0) )
Else
Call rtitem.AppendText( docColl.PostedDate(0) )
End If
richStyle.Bold = False
Call rtitem.AppendStyle(richStyle)
Call rtitem.AddNewLine( 2 )
Set rtitemA = docColl.GetFirstItem( "Body" )
Set rtitemB = docNew.GetFirstItem( "DawText" )
If ( rtitemA.Type = RICHTEXT And _
rtitemB.Type = RICHTEXT ) Then
Call rtitemB.AppendRTItem( rtitemA )
End If
docNew.Kategorie_1 = docColl.Subject(0)
Call docNew.save (True, True)
Set docColl = collection.getNextDocument (docColl)
Loop
End If
End If
Set view = db.GetView("Themen_Alle")
Call view.Refresh
End Sub

Offline gere

  • Aktives Mitglied
  • ***
  • Beiträge: 216
  • Geschlecht: Männlich
Re: Mail an Dokument hängen
« Antwort #2 am: 12.07.05 - 15:22:44 »
Danke, werde das mal probieren... Geht das auch irgendwie mit Formelspache?

Gruß Gere

Offline koehlerbv

  • Moderator
  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 20.460
  • Geschlecht: Männlich
Re: Mail an Dokument hängen
« Antwort #3 am: 12.07.05 - 16:42:08 »
Warum sollte man das in Formelsprache tun (und sich hierbei einen abbrechen, wenn es denn überhaupt gehen würde) ?

Bernhard

 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz