[RESOLVED] [Outlook] Deleting a folder
I want to permanently delete a folder from the "Deleted Items" folder, but the following code won't work:
VB Code:
' Delete temp folder:
Dim myOlApp09 As Outlook.Application, myNameSpace09 As Outlook.NameSpace
Dim myFolder09 As Outlook.MAPIFolder, myFolder08 As Outlook.MAPIFolder
Set myOlApp09 = Outlook.Application
Set myNameSpace09 = myOlApp09.GetNamespace("MAPI")
Set myFolder09 = myNameSpace09.GetDefaultFolder(olFolderDeletedItems)
Set myFolder08 = myFolder09.Folders("Temp M2C Folder")
myFolder08.Delete ' Delete Folder
It doesn't show an error message but the folder isn't being deleted.
I'm programming this in VB6 and its for Outlook 2003.
Can anyone help me?
Re: [Outlook] Deleting a folder
Excuse the double post...
But I still need help with this issue and I won't get it unless this thread is on the first page.
Re: [Outlook] Deleting a folder
Quote:
Originally Posted by __Russell__
Excuse the double post...
But I still need help with this issue and I won't get it unless this thread is on the first page.
Your code is correct.
Try deleting a folder which doesn't have any space in it's name. Create a folder "Temp" and then delete it. once it is in the deleted items folder
try this piece of code...
vb Code:
Set myFolder08 = myFolder09.Folders("Temp")
I don't know if this will help but give it a try...
Re: [Outlook] Deleting a folder
Seems to simple to work, but it does. Apparently the above code doesn't like spaces in a folder's name.
Problem solved. :D
Thanks for the help.