Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Moving emails INTO inbox in outllook.
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01461019
Message ID:
01461021
Vues:
42
yes thanks naomi i partially removed some of the code for demo and forgot to remove that.

k

>Unrelated observation - llAttach doesn't seem to be needed at all and if it's needed, you need to correct its comment and you don't need to use IIF.
>
>>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
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform