Sub GrapIext()
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 sText As String
Application.ScreenUpdating = False
'Set objOutlook = CreateObject("Outlook.Application")
Set objOutlook = CreateObject("Lotus-Notes.Application")
Set objnSpace = objOutlook.GetNamespace("MAPI")
Set objFolder = objnSpace.folders("Persönliche Ordner").folders("Posteingang")
intCount = objFolder.Items.Count
If intCount > 0 Then
For intCounter = 1 To intCount
Set objMsg = objFolder.Items(intCounter)
MsgBox intCounter & " von " & intCount
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
Sub GrapIext()
' An den Absender/Provider Anpassen!!!
'Const strAbsenderName As String = "vorname.nachname@xyz.de"
' Ende "An den Absender Anpassen!!!"
Dim objOutlook As Outlook.Application
Dim objnSpace As Outlook.NameSpace
Dim objFolder As Outlook.MAPIFolder
Dim objMsg As Object
Dim objItem As Outlook.MailItem
Dim intCounter As Integer, intCount As Integer, iRow As Integer
Dim ws As Worksheet
Dim sText As String
Application.ScreenUpdating = False
Set objOutlook = CreateObject("Outlook.Application")
Set objnSpace = objOutlook.GetNamespace("MAPI")
Set objFolder = objnSpace.GetDefaultFolder(olFolderInbox)
intCount = objFolder.Items.Count
If intCount > 0 Then
Set ws = ActiveSheet
iRow = 1
For intCounter = 106 To intCount
Set objMsg = objFolder.Items(intCounter)
If objMsg.Class = olMail Then
Set objItem = objMsg
If UCase(objItem.SenderName) = UCase(strAbsenderName) Then
iRow = iRow + 1
ws.Cells(iRow, 1).Value = objItem.Body
End If
End If
Next intCounter
Set ws = Nothing
End If
Set objnSpace = Nothing
Set objFolder = Nothing
Set objMsg = Nothing
Set objItem = Nothing
Set objOutlook = Nothing
End Sub
Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden
Suche nach den besten AntwortenEntdecke unsere meistgeklickten Beiträge in der Google Suche
Top 100 Threads jetzt ansehen