Hej,
Jag har knåpat ihop en liten kod som läser av information i ett mail i Outlook. Jag har fått till det så att informationen läses och mailet flyttas till borttaget. Nu vill jag dock flytta mailet till en speciell mapp. Men jag får felmeddelande enligt bifogad bild.
Sub main
dim oOutlook, oSafeMailItem, oMailItem, oAttach, oDestFolder
dim oNS, oInbox, oItem, oItems
set oOutlook = CreateObject("Outlook.Application")
Set oSafeMailItem= CreateObject("Redemption.SafeMailItem")
Set oNS=oOutlook.GetNamespace("MAPI")
Set oInbox=oNS.GetDefaultFolder(6)
Set oItems = oInbox.Items
For Each oItem In oItems
If oItem.Subject="Felanmälan" Then
oSafeMailItem.Item=oItem
If CreateTaskFromMailItem(oSafeMailItem)>=0 Then
[B]oItem.Move (oInbox.Folders("Test"))[/B]
End If
End If
Next
Set oSafeMailItem=Nothing
Set oInbox=Nothing
Set oNS=Nothing
Set oOutlook=Nothing
End Sub
oItem.Delete
...funkar...
Någon som har några bra idéer?
Mvh
Henrik
