Hallo zusammen,
folgendes Problem: ich versuche per Mail einen Link, eines bestimmtens dokumentes zu versenden. Problem an der Sache, das Dokument ist ein Antwortdok und der Link verweißt immer auf das Hauptdok. Hier mal der code
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim doc1 As NotesDocument
Dim Alarm As Variant
Dim send As Variant
Dim rtitem As NotesRichTextItem
Dim newDoc As NotesDocument
Dim key1 As Variant
Dim View As NotesView
Set db = session.CurrentDatabase
Set collection = db.AllDocuments
Set doc = collection.GetFirstDocument
While Not (doc Is Nothing)
Alarm = doc.GetItemValue( "Feld" )
If Alarm(0) = Today Then
key1 = doc.GetItemValue( "Feld1" )
send = doc.getItemValue ("send")
Set view = db.GetView("key")
Set doc1 = view.GetDocumentByKey( key1 )
Set newDoc = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( newDoc, "Body" )
Call rtitem.AppendDocLink( doc1, "Link" )
newDoc.Subject = "Alarm!!"
newDoc.SendTo = send
newDoc.Send( False)
End If
Set doc = collection.GetNextDocument(doc)
Wend
End Sub