Einzelnen Beitrag anzeigen
Alt 07.12.2004, 22:23   #4
Hawi
Inventar
 
Registriert seit: 23.12.2001
Beiträge: 2.969


Standard

Ich habe vor Jahren eine Funktion (ab)geschrieben, die das macht. Allerdings gab es in der damaligen ACCESS-Version noch nicht den Typ Hyperlink. Ich habe mich seither nicht mehr viel mit ACCESS beschäftigt, aber unter Google Groops müsstest du auch elegantere Lösungen finden.

Function SendMess(Typ, SendNam)
'Typ=TO oder CC
'Sendnam=Emailadresse

Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
'Dim objOutlookSubject As Outlook.Su

'existierendes oder neues Outlook starten
On Error Resume Next
Set objOutlook = GetObject(, "Outlook.Application")
If Err.Number <> 0 Then
Err.Clear
Set objOutlook = CreateObject("Outlook.Application")
End If

' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
Set objOutlookRecip = .Recipients.Add(SendNam)
If Typ = "TO" Then
' Add the To recipient(s) to the message.
objOutlookRecip.Type = olTo
Else
' Add the CC recipient(s) to the message.
objOutlookRecip.Type = olCC
End If

.Display

End With

Set objOutlook = Nothing

End Function
Hawi ist offline   Mit Zitat antworten