Outlook Objekt - Posteingang abrufen!

  • Hallo!

    Da ich immoment Lust habe mit Objekten zu arbeiten, wollte ich mir mal mit Hilfe eines Outlook Objektes ein paar Mails aus dem Posteingang abrufen.

    Allerdings wird das Script immer mit dem Error Code:

    (19) : ==> The requested action with this object has failed.:
    $OLFold = $OLNaSp.GetDefaultFolder(1)^ ERROR

    Beendet. Hier jetzt erstmal mein Script und die Seiten, die ich zu Hilfe genommen habe:

    Spoiler anzeigen
    [autoit]

    $OLObj = ObjCreate("Outlook.Application")
    If @error Then MsgBox(64, "An error occured! 1", @error)

    [/autoit] [autoit][/autoit] [autoit]

    $OLNaSp = $OLObj.GetNameSpace("MAPI")
    If @error Then MsgBox(64, "An error occured! 2", @error)

    [/autoit] [autoit][/autoit] [autoit]

    $OLFold = $OLNaSp.GetDefaultFolder(1)
    If @error Then MsgBox(64, "An error occured! 3", @error)

    [/autoit] [autoit][/autoit] [autoit]

    MsgBox(64, "Info", $OLFold.Items(5))

    [/autoit]

    Outlook Application Objekt: http://tinyurl.com/nsekuo
    Outlook Application Model: http://tinyurl.com/n2j5n3
    GetDefaultFolder Method: http://tinyurl.com/lyg96m
    GetDefaultFolder Values: http://tinyurl.com/mxmzyc

    Weiß da jemand vllt. etwas drüber oder hat eine Lösung?

    Vielen Dank im Voraus,

    bG, Lenny

    Jaja, Moo does the Cow!

  • Hi,


    edit 11:32:

    probier mal:

    [autoit]

    $OLFold = $OLNaSp.GetDefaultFolder(olFolderInBox)
    ;oder
    $OLFold = $OLNaSp.GetDefaultFolder(6)

    [/autoit]


    ;-))

    Stefan

    2 Mal editiert, zuletzt von ojo (31. August 2009 um 11:32)