Anzeige
Archiv - Navigation
1200to1204
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

E-Mail per Lotus ?

E-Mail per Lotus ?
amintire
Guten morgen alle zusammen,
habe hier im Forum eine Funktion gefunden Tabellen per E-Mail zu versenden.
Mit Outlook funktioniert es, aber leider nicht mit Lotus Notes.
Gibt es da irgendwelche besonderen Einstellungen die vorher gemacht werden müssen?
Da kommt folgende Fehlermeldung wenn ich das Makro ausführe:
Laufzeitfehler '1004':
Die Methode 'SendMail' für das Objekt '_Workbook' ist fehlgeschlagen.
Debuggen (folgendes wird gelb markiert):
ActiveWorkbook.SendMail ThisWorkbook.Worksheets("Tabelle1").Cells(5, 1), "Diese Tabelle wurde als Mail versandt"

Der gesamte Code ist:
Option Explicit
Sub einzelnes_blatt_senden()
'* 24.08.06, 22.04.07                             *
'* erstellt von Karin, http://beverly.excelhost.de*
'* beverly@excelhost.de                           *
Dim strTabelle As String                ' Variable für den Tabellennamen
Dim wsTabelle As Worksheet              ' Variable für die Tabelle als Objekt
'   Tabelle2 als Standard festlegen
strTabelle = "Tabelle versenden"
'   Name der zu versendenen Tabelle abfragen
strTabelle = InputBox("Welches Blatt möchten Sie senden?" & vbCrLf & _
vbCrLf & "Bitte den Tabellennamen eingeben", , strTabelle)
'   kein Abbruch der Eingabe
If strTabelle  "" Then
'       Schleife über alle Arbeitsblätter
For Each wsTabelle In ThisWorkbook.Sheets
'           Name der Tabelle entspricht dem der zu versendenen Tabelle
If wsTabelle.Name = strTabelle Then
'               Bildschirmaktualisierung aus
Application.ScreenUpdating = False
'               Tabelle komplett kopieren
Sheets(strTabelle).Copy
'               aktive Arbeitsmappe mit Mailbenachrichtigung "Diese Tabelle wurde als Mail  _
versandt" versenden
ActiveWorkbook.SendMail ThisWorkbook.Worksheets("Tabelle1").Cells(5, 1), "Diese  _
Tabelle wurde als Mail versandt"
'               aktive Arbeitsmappe schließen ohne Speichern
ActiveWorkbook.Close False
'               Bildschirmaktualisierung ein
Application.ScreenUpdating = True
'               Schleife verlassen
Exit For
Else
'               Tabelle mit dem eingegebenen Namen ist nicht vorhanden
If wsTabelle.Name = ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count).Name Then  _
MsgBox "Diese Tabelle gibt es nicht"
End If
Next wsTabelle
End If
End Sub

Lieben Gruß und einen wunderschönen guten morgen,
Amina

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Benutzer
Anzeige
AW: E-Mail per Lotus ?
17.02.2011 09:19:46
Ralf_P
Hallo amintire,
hiermit kannst du prüfen, ob auf dem Rechner Outlook oder Lotus installiert ist.
Private Sub CommandButton1_Click()
Set WshShell = CreateObject("WScript.Shell")
'MsgBox WshShell.RegRead("HKEY_CLASSES_ROOT\mailto\shell\open\command\")
'MsgBox WshShell.RegRead("HKEY_LOCAL_MACHINE\Software\Clients\Mail\")
ActiveSheet.Range("A1").Value = WshShell.RegRead("HKEY_CLASSES_ROOT\mailto\shell\open\command\ _
")
ActiveSheet.Range("A2").Value = WshShell.RegRead("HKEY_LOCAL_MACHINE\Software\Clients\Mail\")
End Sub
Dann kannst Du Dich versuchen:
Lotus Notes Send EMail from VB or VBA  http://www.fabalou.com/VBandVBA/lotusnotesmail.asp
Diesen Thread habe ich noch in meinem Archiv gefunden:
Re: Mehrere Dateien aus Excel nach Lotus mailen
hi,
ein bisschen adaptieren wirst du es müssen. z.B.
Sub Senden()
Dim strCopyto As String
Dim strBlindCopyto As String
Dim strServer As String
Dim session
Set session = CreateObject("notes.NotesSession")
strSubject = "Mein Betreff"
strBodyText = "Mein Nachrichtentext"
strSendTo = "Empfänger@Empfänger.com"
strDatei1 = "C:\Config.sys"
strDatei2 = "C:\Autoexec.bat"
Dim obj
Dim rtItem
Dim docMail 'This will return the server and path to the current users mail file.
Dim db
Dim s
Set s = CreateObject("Notes.Notessession") 'New doesn't work here for some reason
Set db = s.GETDATABASE("", "")
'Creates a new document in the Mail Database
db.OPENMAIL
Set docMail = db.CREATEDOCUMENT 'When creating documents via VB the default values are not calculated so all the fields required 'must be set programmatically
Call docMail.REPLACEITEMVALUE("Form", "Memo")
strCopyto = "" 'Who to send a copy to
strBlindCopyto = "" 'Who you want to be blind copied to
Call docMail.REPLACEITEMVALUE("Subject", strSubject)
Call docMail.REPLACEITEMVALUE("SendTo", strSendTo)
Call docMail.REPLACEITEMVALUE("strCopyTo", strCopyto)
Call docMail.REPLACEITEMVALUE("BlindCopyTo", strBlindCopyto)
'Creates the memo body field, which contains main info and attachments
Set rtItem = docMail.CREATERICHTEXTITEM("Body")
Call rtItem.APPENDTEXT("Hallo Du,") ' Add some text to the body field
Call rtItem.ADDNEWLINE(2) ' Adds 2 blank lines to the body field
Call rtItem.APPENDTEXT(strBodyText)
Call rtItem.ADDNEWLINE(2)
'Embeds the file with the pathname stored in strpathname
Set obj = rtItem.EMBEDOBJECT(1454, "", strDatei1)
Set obj = rtItem.EMBEDOBJECT(1454, "", strDatei2)
Call rtItem.ADDNEWLINE(2) ' Adds 2 blank lines to the body field
Call rtItem.APPENDTEXT("Mit freundlichen Grüßen, ")
Call rtItem.ADDNEWLINE(1)
Call rtItem.APPENDTEXT("Mein Name")
'Call docMail.SEND(False) 'Don't include this to save it in the drafts view '
Call docMail.Save(True, True) 'Include this to save in the send view
End Sub
Hoffe, das hilft die weiter,
Sam
Re: Mehrere Dateien aus Excel nach Lotus mailen
Vielen Dank erstmal. Ich werde es auprobieren
Re: Mehrere Dateien aus Excel nach Lotus mailen
Ich konnte das Problem heute beseitigen
Viiiiielen Dank
Anzeige
AW: E-Mail per Lotus ?
17.02.2011 13:45:15
amintire
Hallo Ralf,
also das mit der Überprüfung hat funktioniert, ist Standartmäßig Lotus Notes.
Der andere Code klappt irgendwie gar nicht.
Muss ich da was beachten?
Lieben Gruß
Amina

132 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige

Links zu Excel-Dialogen

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige