C# Outlook isn't moving all emails -
I am using Outlook Interop to move from one folder to another (after receiving all the attachments, but It works) but it is not copying all the emails I have tried to wait, but it has no effect. First of all, it will be taken 6, then 3, then 1. Can anyone tell me why is not she running?
The relevant code is below:
application oOutlook = new application (); Namespace ONS = Outercle.net namespace ("MAPI"); Recipient ORP = ON Create Recipe ("Content Help"); MAPIFolder Inbox = ON GateShare Default Folder (ORP, Olendefault Folders.olfolder Inbox); MAPIFolder nihSub = inbox.folders ["NIH"]; MAPIFolder nihArchive = inbox.folders ["NIHarchive"]; Item nihItems = nihSub.Items; MailItem moveMail = Null; // inboxItems = inboxItems.Restrict ("[unread] = false"); Int engagement = 0; Try {Foreach (object collection in nihItems) {moveMail = MailItem as archive item name; If (moveMail! = Null) {Console.WriteLine ("walk {0}", moveMail.Subject.ToString ()); String header = move (string) moveMail.Subject; MoveMail.Move (nihArchive); }}}}}
index Each time you loop on the move gets reset, So you never have more than half the items. Use a loop or countdown from OlItems. Calculation 1.
Comments
Post a Comment