good idea! - alas niether worked
loNameSpace.Folders("Personal Folders").Folders.Remove('TempBox')
loNameSpace.Folders("Personal Folders").Folders.Delete('TempBox')
Perhaps there is a better way to deal with the problem i'm trying to overcome. Here is problem: When i move emails to a folder called 'processed' there are always a couple of unread emails left in the inbox. i suspect the automation looses it's place when it moves to another folder and skips emails in the inbox.
so my iniitial idea was to count unread - and if number was not at 0, have the program loop and go through the lot again. to do this i have to move irrelevant emails into a folder called "tempbox" then move them back after completing processing.
Perhaps you can think of a more efficient way of dealing with the initial problem (of missing unread) to save me creating a new folder.
thanks for the tries and thoughts.
k
>>I have successfully created a folder called "TempBox". How do i delete this folder after i have finished?
>>
>>thanks for all the help.
>>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
>>
>>Local loNewFolder
>>
>>loNewFolder=loNameSpace.Folders("Personal Folders").Folders.Add('TempBox')
>>
>>
>
>Sorry, try
>
>loNameSpace.Folders("Personal Folders").Folders.Remove('TempBox')