Halli Hallo,
ich versuche ein Attachment (PDF Lieferscheine) in meine mittelsLotius Script generierte Mail einzufügen.
Das Problem ist das sich das Attachment immer verändert und ich bin gerade echt ein wenig ratlose, kann mir jmd ein Tipp bzw Rat geben?
Quellcode:
Function MailSend (mail As NotesDocument)
Dim se As New NotesSession
Dim db As NotesDatabase
Dim TextItem As NotesRichTextItem
Dim TextStyle As NotesRichTextStyle
Dim empfaenger As String
Dim datei As String
Dim pdf As String
Set db = se.CurrentDatabase
'Neues Dokument erstellen
Set mail = New NotesDocument(db)
'Empfänger
'empfaenger = InputBox("Please insert the receiver", "Send to","Receiver")
'If
'Standardfelder setzen
Call mail.ReplaceItemValue("sendto", empfaenger)
Call mail.ReplaceItemValue("subject", "ABC Shipping Information")
'Feld Body erstellen
Set TextItem = New NotesRichTextItem(mail, "body")
Set TextStyle = se.CreateRichTextStyle
TextStyle.Bold = True
Call Textitem.AppendStyle(TextStyle)
'Text einfügen
Call TextItem.AppendText("Dear Sir or Madam")
TextStyle.Bold = False
Call Textitem.AddNewline(2)
Textstyle.FontSize = 10
Textstyle.NotesColor = 0
Call Textitem.AppendStyle(TextStyle)
Call Textitem.AppendText("Please be informed, that a shipment has left our warehouse with UPS.")
Call Textitem.AppendText("In the attachment you will find their delivery note.")
Textitem.AddNewline(3)
Call Textitem.AppendText("To track your shipment, please use the following link:")
Textitem.AddNewline(1)
Call Textitem.AppendText("http://www.ups.com/tracking/tracking.html ")
Textitem.AddNewline(3)
Call Textitem.AppendText("Kind Regards")
Textitem.AddNewline(2)
Call Textitem.AppendText("Order Processing Department")
Textitem.Addnewline(1)
Call Textitem.AppendText("ABC GmbH")
Textitem.AddNewline(2)
Textstyle.FontSize = 10
Textstyle.NotesColor = 0
pdf = Dir("\\Server\DeptHomes\Operations\OK Logistics\CSV\Lieferscheine\", 0)
If pdf = "" Then
Else
Call Textitem.EmbedObject(EMBED_ATTACHMENT,"","\\Server\DeptHomes\Operations\OK Logistics\CSV\Lieferscheine\")
End If
'Dokument senden
Call mail.Send(True)
End Function