Hello,
it is normally no possible to delete the default folder "Contacts" (olFolderContacts) in a .pst file.
Would it be maybe possible to delete via VBA and how?
I tried via VBA macro but the folder can't be delete:
But any other methods are welcome.
Thanks!
it is normally no possible to delete the default folder "Contacts" (olFolderContacts) in a .pst file.
Would it be maybe possible to delete via VBA and how?
I tried via VBA macro but the folder can't be delete:
Code:
Sub DeleteFolder()
Dim olApp As Outlook.Application
Dim olNamespace As Outlook.NameSpace
Dim olFolder As Outlook.MAPIFolder
Set olApp = New Outlook.Application
Set olNamespace = olApp.GetNamespace("MAPI")
'Set olFolder = olNamespace.Session.folders("2. Archiv_Gelöschte Objekte").folders("Contacts")
Set olFolder = olNamespace.Session.folders("nikolay@chervenkov.de_Lokal").folders(olFolderContacts)
If msgbox("Soll der Ordner gelöscht werden?", vbYesNo + vbQuestion, "Löschen?") = vbYes Then
olFolder.Delete
msgbox "Ordner wurde gelöscht", 64, "Hinweis"
End If
End Sub
But any other methods are welcome.
Thanks!