Ich finde für mein Problem mal wieder keine Lösung...
Ich will aus einem selbst erstellten Mail-Formblatt Daten aus den Textfeldern nach Excel bringen.
Das hier bringt mir "nur" die Standardwerte wie Absender usw.
Sub ReadOutlookInbox()
Dim objOLApp As Outlook.Application
Dim objFolder As Outlook.MAPIFolder
Dim objItems As Outlook.Items
Dim objNameSpace As Outlook.NameSpace
Dim objItem As Object
Dim i As Integer
Set objOLApp = CreateObject("Outlook.Application")
Set objNameSpace = objOLApp.GetNamespace("MAPI")
Set objFolder = objNameSpace.GetDefaultFolder(olFolderInbox)
Set objItems = objFolder.Items
'Worksheets.Add
i = 1
For Each objItem In objItems
If objItem "Stückzahlmeldung" Then GoTo Ende
If objItem.Class = olMail Then
Cells(i, 1) = objItem.SenderName ' Absender
Cells(i, 2) = objItem.Subject ' Betreff
Cells(i, 3) = objItem.ReceivedTime ' Erhalten am
Cells(i, 4) = objItem.Size ' E-Mail-Größe
Cells(i, 5) = objItem.Body ' Inhalt
End If
i = i + 1
Ende:
Next
For i = 1 To 5
Columns(i).AutoFit
Next i
Set objNameSpace = Nothing
Set objFolder = Nothing
Set objItems = Nothing
End Sub
Ich will aber auch die Daten aus TextBox1 bis TextBox4 haben.Geht das irgendwie?
Danke für die Hilfe!!!
Gruß
Werner