Live-Forum - Die aktuellen Beiträge
Datum
Titel
24.04.2024 19:29:30
24.04.2024 18:49:56
Anzeige
Archiv - Navigation
472to476
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
472to476
472to476
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

Function-Funktion???

Function-Funktion?
25.08.2004 09:32:46
Frederic
Hi Leute,
eine Frage:
Wie weise ich einer Schaltfläche dieses Makro zu:

Function SendNotesMail(strMessage As String, _
End Function

Ich kann soweit ich weiss nur Sub() ...End

Sub zuweisen.
Danke für Eure Hilfe
Frederic

		

4
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Function-Funktion?
Dr.
Du schreibst ein Sub, in dem die Funktion ausgeführt wird und hängst es an die Schaltfläche.
AW: Function-Funktion?
25.08.2004 09:39:09
Frederic
Hi,
danke für die Antwort, dass dachte ich auch, aber bei diesem Code funktionierts leider net:

Sub SendLotusNots()

Function SendNotesMail(strMessage As String, _
strSubject As String, _
strSendTo As String, _
lngLogo As Long, strAttachment As String)
On Error GoTo NotesMail_Err
Dim lnSession As Object
Dim lnDatabase As Object
Dim lnDocument As Object
Dim lnRTStyle As Object
Dim lRTItem As Object
Dim lnATTACHMENT As Object
Dim sMessage As String
Dim lLogo As Long
''start a notes session...
Set lnSession = CreateObject("Notes.Notessession")
''create a new style object to control t
' he appearance of the message
Set lnRTStyle = lnSession.CreateRichTextStyle
''get the current database...
Set lnDatabase = lnSession.GetDatabase("", "")
lnDatabase.OpenMail
''create a new document
Set lnDocument = lnDatabase.CreateDocument
''create a new NotesRichTextItem object
' in which we can store,
''and format the main message body in Ri
' chText format
Set lnRTItem = lnDocument.CreateRichTextItem("Body")
If strAttachment <> "" Then
Set lnATTACHMENT = lnRTItem.EMBEDOBJECT _
(1454, "", strAttachment, "Sample")
End If
sMessage = "Mail sent: " & Date & " " & Time & vbCrLf & vbCrLf & _
strMessage
''format the message
lnRTStyle.NotesFont = 4 ''Courier
lnRTStyle.Bold = True
lnRTStyle.NotesColor = 2 ''red
Call lnRTItem.AppendStyle(lnRTStyle)
Call lnRTItem.AppendText(sMessage)
'Call lnRTItem.AddNewLine(1)
''logo values are between 0 and 31
lLogo = lngLogo
If lLogo < 0 Or lLogo > 31 Then
lLogo = 0
End If
''replace some of the fields that we nee
' d...
With lnDocument
''who we want to send to...
''recipient
.ReplaceItemValue "frederic.anders@schwan-stabilo.com", strSendTo
''subject
.ReplaceItemValue "Subject", strSubject
''body - non RichText
'.ReplaceItemValue "Body", "The body of
' the message!"
''set the logo! (letter head)
.ReplaceItemValue "Logo", "StdNotesLtr" & Trim$(Str$(lLogo))
''send the message
.Send False
End With
Set lRTItem = Nothing
Set lnRTStyle = Nothing
Set lnDocument = Nothing
Set lnDatabase = Nothing
Set lnSession = Nothing
MsgBox "Mail was sent!", vbInformation, _
strSendTo
Exit Function
NotesMail_Err:
MsgBox Err.Description, _
vbExclamation, _
"Send mail error! (" & Trim$(Str$(Err)) & ")"
SendNotesMail "Hello! This is an email message! With an attachment", _
"Test Lotus Notes Email - Attachment test", _
"frederic.anders@schwan-stabilo.com", 0, "C:\autoexec.bat"
End Function

End Sub

Anzeige
AW: Function-Funktion?
Reinhard
Hi Frederic,
nicht so:

Sub tt()

Function bb(b As Integer)
bb = b * 5
End Function

End Sub

sondern so:

Sub tt()
MsgBox bb(3)
End Sub


Function bb(b As Integer)
bb = b * 5
End Function

Gruß
Reinhard
AW: Function-Funktion?
25.08.2004 13:28:44
Frederic
Danke Reinhard, jetzt hats geklappt!
Frederic

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige