Domino 9 und frühere Versionen > ND6: Entwicklung
Antwort mit Vorlage übernimmt keinen Anhang
waldt:
Hallo zusammen,
ich habe hier ein Script von eknori gefunden, welches das macht was ich benötige.
Benutzer sollen auf eine Mail antworten und dabei eine Vorlage auswählen.
Das klappt auch soweit gut.
Allerdings übernimmt die Funktion keine Anhänge der in der Vorlage drin sind.
Kann mir da jemand helfen?
Hier das Script:
Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As notesdocumentcollection
Dim replyToUIDoc As NotesUIDocument
Dim stationeryDoc As NotesDocument
Set db = session.CurrentDatabase
Set replyToUIDoc = ws.ComposeDocument("","","Reply")
Set collection = ws.Picklistcollection(PICKLIST_CUSTOM, False, db.server, db.filepath, "Stationery", "Select Stationery", "Please select stationery for new memo.")
Set stationeryDoc = collection.getfirstdocument
If Not stationeryDoc Is Nothing Then
Dim stationeryBodyItem
Set stationeryBodyItem = stationeryDoc.getfirstitem("Body")
Call replyToUIDoc.GotoField( "Body" )
Call replyToUIDoc.SelectAll
Call replyToUIDoc.Cut
Call replyToUIDoc.InsertText( stationeryBodyItem.GetFormattedText( False, 0 ) )
Else
Call replyToUIDoc.Close
End If
End Sub
Vielen Dank im voraus,
Gruß
Thomas
Axel:
Das kann auch so nicht funktionieren. Du markierst zwar den gesamten Inhalt des Body-Feldes, fügst aber dann nur Text in das andere Feld ein.
Schau dir mal die Methode CopyItem aus der Klasse NotesDocument in der Designer-Hilfe an. Dort ist auch ein Beispiel vorhanden, dass sich ein Stück weit sich auf deine Problematik bezieht.
Axel
waldt:
Hallo Axel,
danke für die schnelle Antwort.
Ich bin leider nicht so fit in der Entwicklung.
Ich bin Administrator, werde aber versuchen was rauszufinden.
Nur so lernt man was :-)
Danke für die schnelle Info.
Wenn ich probleme bekomme, melde ich mich noch mal.
Gruß
Thomas
Axel:
Hier mal auf die Schnelle eine ungetesteter Lösungsvorschlag aus dem Kopf.
Dim replyToUIDoc As NotesUIDocument
Dim replyToDoc As NotesDocument
Dim stationeryDoc As NotesDocument
Dim stationeryBodyItem As NotesRichTextItem
Set db = session.CurrentDatabase
Set collection = ws.Picklistcollection(PICKLIST_CUSTOM, False, db.server, db.filepath, "Stationery", "Select Stationery", "Please select stationery for new memo.")
Set stationeryDoc = collection.getfirstdocument
If Not stationeryDoc Is Nothing Then
Set replyToDoc = New NotesDocument(db)
replyToDoc.Form="Reply"
Set stationeryBodyItem = stationeryDoc.getfirstitem("Body")
Call replyToDoc.CopyItem( stationeryBodyItem, "Body" )
Set replyToUIDoc = ws.EditDocument(replyToDoc)
Call replyToUIDoc.Refresh(True)
End If
...
Axel
waldt:
Hallo Axel,
Vielen Dank. Ich bin tatsächlich nicht weiter gekommen.
Das Script von dir macht aber Probleme!
Type mismatch on: DB in Zeile
Set replyToDoc = New NotesDocument(db)
Gruß
Thomas
Navigation
[0] Themen-Index
[#] Nächste Seite
Zur normalen Ansicht wechseln