First off, I'm trying to call it in OnAcceptMessage, and I'm not positive this is legit (but I can't find any documentation that it isn't). If the message has to already exist in one IMAP folder before you copy it to another, then that's my problem, and this isn't going to work. Can somebody confirm or deny this?
Assuming that it is legit, here's the code that I can't get to work:
Code: Select all
Dim oApp, oAcct
Set oApp = CreateObject("hMailServer.Application")
Call oApp.Authenticate(hMSAuthUser, hMSAuthPass)
Set oAcct = oApp.Domains.ItemByName(myDomain).Accounts.ItemByAddress(myAccount)
oMsg.Copy(oAcct.IMAPFolders.ItemByName(myFolder).ID)
Am I getting IDs mixed up? The docs for Message.Copy are pretty sparse - I'm not positive that iDestinationFolderID is the same database identifier as IMAPFolder.ID (but if it isn't, then I don't know what it is).
Any ideas appreciated
Thanks
ras