Moin!
bisher habe ich mit folgendem Code immer eine E-Mail in Outlook generieren lassen - hat geklappt.
Nun wollte ich das auf mehrere ausweiten und als Parameter eine List Of String übergeben. Angepasst habe ich folgenden Bereich:
Aber das funktioniert nicht - besser gesagt es wird der Abschnitt
angemerkt.
Kann mir einer weiterhelfen?
Gruß Jan
*Topic verschoben*
bisher habe ich mit folgendem Code immer eine E-Mail in Outlook generieren lassen - hat geklappt.
VB.NET-Quellcode
- Public Sub OpenOutlook(BetreffZeile As String, Body As String, _AdressenEmail As String, Optional SendCC As Boolean = False)
- Dim objOutlook As Object
- Dim objOutlookMsg As Object
- Const olMailItem = 0
- 'Const olBCC = 3
- Const olImportanceHigh = 1
- Const olCC = 2
- Const olTo = 1
- Dim HowToAdress As Integer = olTo
- If SendCC = True Then HowToAdress = olCC
- Try
- objOutlook = CreateObject("Outlook.Application")
- objOutlookMsg = objOutlook.CreateItem(olMailItem)
- With objOutlookMsg
- Dim objOutlookRecip As Object = .Recipients.Add(_AdressenEmail)
- objOutlookRecip.type = HowToAdress
- .Subject = BetreffZeile
- .Body = Body
- .Importance = olImportanceHigh
- .Display() ' use .send() to send
- End With
- objOutlookMsg = Nothing
- objOutlook = Nothing
- Catch ex As Exception
- XMsgBox.ShowDialog("Leider ist ein Fehler bei der Erstellung der Email aufgetreten!" & vbCrLf & ex.ToString & vbCrLf &
- "EMail:=" & _AdressenEmail & Environment.NewLine &
- "Betreff:=" & BetreffZeile, _k_AppName, XMsgBoxButtons.OK, XMsgBoxIcon.Critical)
- End Try
- End Sub
Nun wollte ich das auf mehrere ausweiten und als Parameter eine List Of String übergeben. Angepasst habe ich folgenden Bereich:
VB.NET-Quellcode
Aber das funktioniert nicht - besser gesagt es wird der Abschnitt
angemerkt.
Kann mir einer weiterhelfen?
Gruß Jan
*Topic verschoben*
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Marcus Gräfe“ ()