I am trying to access the root level to the delete the Folder Mike but it says the object is not found. How do I access the root level to delete the Mike folder?
The folder is not located on the inbox tree but rather the root of my mailbox.
Any help appreciated.
Thanks
Mike
Sub CommandButton1_Click()
Set oNameSpace = Application.GetNamespace("MAPI")
Set oFolder = oNameSpace.GetDefaultFolder(10)
Set oOldFolder = oFolder.Folders("Mike")
'Prompt the user for confirmation
Dim strPrompt
strPrompt = "Are you sure you want to delete the folder?"
If MsgBox(strPrompt, vbYesNo + vbQuestion) = vbYes Then
oOldFolder.Delete
MsgBox ("Folder deleted")
End If
End Sub
The folder is not located on the inbox tree but rather the root of my mailbox.
Any help appreciated.
Thanks
Mike
Sub CommandButton1_Click()
Set oNameSpace = Application.GetNamespace("MAPI")
Set oFolder = oNameSpace.GetDefaultFolder(10)
Set oOldFolder = oFolder.Folders("Mike")
'Prompt the user for confirmation
Dim strPrompt
strPrompt = "Are you sure you want to delete the folder?"
If MsgBox(strPrompt, vbYesNo + vbQuestion) = vbYes Then
oOldFolder.Delete
MsgBox ("Folder deleted")
End If
End Sub