Depends on whether or not the mailbox is added to your profile. If it is, that is if you can see the mailbox name and its subfolders in the folder explorer (ctrl+6), then this would work, assuming that "invoices" is a subfolder of the inbox:
set folder=application.session.folders("enter mailbox...
Ok, I thought the OLE Automation is missing.
I'd walk through the code execution step by step by pressing f8, and see where it doesn't behave as expected. For instance, which line is executed before the error comes up, is any rule exucted at all?
The error simply means the subfolder doesn't exist. There's no difference between the versions of Outlook; however, it looks like the folder hierarchy isn't identical on all your machines.
Replace it by
mymail.move drafts
And outside the loop, of course, before the line mentioned above gets called, write:
dim drafts as folder
set drafts=myoutlook.session.getdefaultfolder(olfolderdrafts)
The property name is Categories. When done with changing properties, you need to call Save eventually. Do so before moving the item.
The best souce for learning the object model ist the object browser. Press f2 to open it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.