Hallo Mr. K.
vielen Dank für die schnelle Antwort, ich habe dein Vorschlag bei mir mal probiert, es läuft Fehlerfrei durch, jedoch wird Outlook immer noch minimiert angezeigt nach dem Start.
Den Verweis habe ich gesetzt, sBody hab ich nur fürs Forum rausgenommen.
Gegoogelt habe ich in den vergangenen Wochen viel und auch viel ausprobiert, leider mit immer dem selben Resultat: Outlook bleibt minimiert gestartet.
Für weitere Vorschläge bin ich dir sehr dankbar
Gruss Vittorio0
PS: wie macht man das mit dem schön nummerierten Source Listing? Habe <>Quellcode probiert
Den nachfolgenden Code hab auch in div. Foren gefunden, verstehen tu ich ihn aber leider nicht :(
<strong>
Public
Function
SendOutlook</strong>(sSubject
As
String
, sTo
As
String
,
Optional
sCC
As
String
,
Optional
sBcc
As
String
,
Optional
sBody
As
String
,
Optional
sAttachment
As
String
,
Optional
sAttachment1
As
String
,
Optional
sAttachment2
As
String
)
Dim
OutApp
As
Outlook.Application
Dim
OutMail
As
Outlook.MailItem
Dim
OutAccount
As
Outlook.Account
Dim
strbody
As
String
Set
OutApp = CreateObject(
"Outlook.Application"
)
Set
OutMail = OutApp.CreateItem(olMailItem)
Set
OutAccount = OutApp.Session.Accounts(
"vk@hispeed.ch"
)
Dim
myOlExp
As
Outlook.Explorer
Dim
myOlExps
As
Outlook.Explorers
Dim
x
As
Long
Set
myOlExps = OutApp.Explorers
For
x = 1
To
myOlExps.Count
myOlExps.Item(x).WindowState = olMaximized
Next
x
sBody =
"Im Anhang finde Sie die Rechnung."
&
"<br>Beste Grüsse"
&
"<br>Vittorio0"
OutMail.Attachments.Add (sAttachment)
On
Error
Resume
Next
With
OutMail
.
To
= sTo
.CC = sCC
.BCC =
""
.Subject = sSubject
.HTMLBody = sBody
.SendUsingAccount = OutAccount
.Display
End
With
On
Error
GoTo
0
Set
OutMail =
Nothing
Set
OutApp =
Nothing
Set
OutAccount =
Nothing
End
Function