Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Anzeige
Inhaltsverzeichnis

Outlookfrage - sorry

Forumthread: Outlookfrage - sorry

Outlookfrage - sorry
22.11.2002 12:04:20
Chiren
Hallo,

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

Anzeige

1
Beitrag zum Forumthread
Beitrag zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
Re: Outlookfrage - sorry
22.11.2002 14:08:58
Andreas Schindlder
Da hast Du einen kleinen Fehler:

es heißt:
with objMsg.Attachments.Item(1) nicht Items....

anstelle von obj.Msg.delete würde ich

objMsg.Move destFolder

verwenden. Dann ist der Mist aus dem Eingangskasten auch draußen.

Andreas

Anzeige
Anzeige
Anzeige
Live-Forum - Die aktuellen Beiträge
Datum
Titel
14.05.2026 13:31:09
14.05.2026 09:50:42
13.05.2026 19:14:18