ich versuche eine CSV datei aus Excel heraus mit lotus notes zu versenden , funktioniert soweit auch , Probleme habe ich damit das csv file als semikolon getrennt zu speichern. Hat jemand eien Idee wie der Code geändert werden sollte?
Sub send()
Dim stFileName As String
Dim vaRecipients As Variant
Dim noSession As Object
Dim noDatabase As Object
Dim noDocument As Object
Dim noEmbedObject As Object
Dim noAttachment As Object
Dim stAttachment As String
Dim strDateiname As String
Dim strAntwort As String
' "Worksheet ASN soll als CSV Semikolon getrennt gepeichert werden "
'Copy the active sheet to a new temporarily workbook.
With Worksheets("ASN").Copy
strDateiname = "sjj_asn_" & Range("B1").Value & Format(Now, "_yyyy_mm_dd_hhmm") & ".csv"
'With ActiveSheet
'.Copy
'stFileName = .Range("A1").Value
End With
stAttachment = stPath & "\" & strDateiname '& ".csv"
'Save and close the temporarily workbook.
With ActiveWorkbook
'.SaveAs stAttachment
.SaveAs ("C:\Attachments\" & strDateiname), FileFormat:=xlCSV, local:=True
End With
'Create the list of recipients.
vaRecipients = VBA.Array("test@test.com", "")
'Instantiate the Lotus Notes COM's Objects.
Set noSession = CreateObject("Notes.NotesSession")
Set noDatabase = noSession.GETDATABASE("", "")
'If Lotus Notes is not open then open the mail-part of it.
If noDatabase.IsOpen = False Then noDatabase.OPENMAIL
'Create the e-mail and the attachment.
Set noDocument = noDatabase.CreateDocument
Set noAttachment = noDocument.CreateRichTextItem("stAttachment")
Set noEmbedObject = noAttachment.EmbedObject(EMBED_ATTACHMENT, "", stAttachment)
'Add values to the created e-mail main properties.
With noDocument
.form = "Memo"
.SendTo = vaRecipients
' .CopyTo = vaCopyTo
.Subject = stSubject
.Body = vaMsg
.SaveMessageOnSend = True
.PostedDate = Now()
.Send 0, vaRecipients
End With
'Delete the temporarily workbook.
Kill stAttachment
'Release objects from memory.
Set noEmbedObject = Nothing
Set noAttachment = Nothing
Set noDocument = Nothing
Set noDatabase = Nothing
Set noSession = Nothing
MsgBox "The e-mail has successfully been created and distributed", vbInformation
End Sub
Grüße Rene