Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moving emails INTO inbox in outllook.
Message
From
19/04/2010 20:11:15
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Moving emails INTO inbox in outllook.
Miscellaneous
Thread ID:
01461019
Message ID:
01461019
Views:
146
the code below moves emails from inbox to a folder called inboxtemp.
After all emails have been transferred to inboxtemp, i would like to move them all back to inbox. They are in 'unread' state in inboxtemp.
Is there a simple way to do this?

(The why of it is, (if you're interested) new emails are processed and moved to a folder called 'processed' those that do not relate to this task are moved to 'inboxtemp'. so stage one is complete now i need stage 2 - move 'em all back.)

many thanks
k
Local loOutlook   As Outlook.Application
Local loNameSpace As Outlook.NameSpace
Local loInBox     As Object
Local loMSG      As Outlook.MailItem
Local lnUnRead    As Integer
Local loAttach,llAttach

#Define olFolderInBox      6


loOutlook   = Createobject('Outlook.Application') &&
loNameSpace = loOutlook.GetNamespace("MAPI")
loInBox     = loNameSpace.GetDefaultFolder(olFolderInBox)
lnUnRead    = 0

For Each loMSG In loInBox.Items
If loMSG.UnRead
		loAttach = loMSG.attachments   && attachments object
		llAttach = Iif(loAttach.Count > 0,.T.,.F.)   && number of attachments
		
		lnUnRead = lnUnRead + 1

		tem= loMSG.SenderName
		temO=loMSG.SenderName
		son = mdy(loMSG.SentOn)
		sub = loMSG.Subject

=loMSG.Move(loNameSpace.Folders("Personal Folders").Folders("inboxtemp")) 


Endif

Endfor
Next
Reply
Map
View

Click here to load this message in the networking platform