erstmal muß ich sagen, das Forum hier ist wirklich klasse. Es hat mir schon sehr oft bei VBA Problemen geholfen. Jetzt habe ich aber ein Problem, was ich bis jetzt auch nicht durch das durchsuchen dieses Forums lösen konnte. Und zwar geht es um folgendes Problem:
Mit dem folgenden Coding lese ich Emails aus einem bestimmten Outlook-Ordner aus und füge den Text des Mails als neues Arbeitsblatt in meine Excel Datei ein um anschließend bestimmte Werte aus diesem Email-Text zu selektieren.
Sub Mails_auslesen()
Dim objOutlook As Object
Dim objnSpace As Object
Dim objFolder As Object
Dim objMsg As Object
Dim intCounter As Integer, intCount As Integer, iRow As Integer
Dim sTxt As String
Application.ScreenUpdating = False
Set objOutlook = CreateObject("Outlook.Application")
Set objnSpace = objOutlook.GetNamespace("MAPI")
Set objFolder = objnSpace.folders("Persönliche Ordner")
intCount = objFolder.Items.Count
If intCount > 0 Then
For intCounter = 1 To intCount
Set objMsg = objFolder.Items(intCounter)
Worksheets.Add after:=Worksheets(Worksheets.Count)
objMsg.SaveAs ThisWorkbook.Path & "\temp.txt", olTXT
Close
iRow = 0
Open ThisWorkbook.Path & "\temp.txt" For Input As #1
Do Until EOF(1)
iRow = iRow + 1
Line Input #1, sTxt
Cells(iRow, 1).Value = "'" & sTxt
Loop
Close
Next intCounter
Kill ThisWorkbook.Path & "\temp.txt"
End If
Set objnSpace = Nothing
Set objFolder = Nothing
Set objMsg = Nothing
Set objOutlook = Nothing
End Sub
Funktioniert mit dem "normalen" Outlook auch wunderbar! Jetzt möchte ich das gleiche aber mit Outlook Express machen. Dies scheitert aber schon beim Finden des "Outlook-Express-Ordners"!
Kann mir hier jemand weiterhelfen???
Danke schon mal!