ich will mit Excel ein Outlookpostfach auslesen und den Inhalt in ein anderes schreiben. Aber irgendwie funktioniert das nicht so wie ich es will. Kennt jemand eine Funktion dafür? Copy befehl oder so???
Gruß
Chiren
Codebeispiel:
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("Postfach - Molanda John").Folders("Gelöschte Objekte") ' "Posteingang"
Set destFolder = objnSpace.Folders("Postfach - Molanda John").Folders("Ablagen")
intCount = objFolder.Items.Count
MsgBox (intCount)
If intCount = 0 Then
MsgBox "Keine Bestellung vorhanden!"
End
End If
For i = 1 To intCount
Set objMsg = objFolder.Items(1)
With objMsg.Attachments.Items(1)
.SaveAsFile "c:\bestellungen\" & .Filename
End With
'********
' wie kopiere ich die Mail vom obj.folder in den dest.folder ???
'********
objMsg.Delete
Next i
Set objOutlook = Nothing
Set objFolder = Nothing
Set destFolder = Nothing