J
jual
Hello,
I have run into the scenario in which a pst which was opened using
AddStore was subsequently deleted or moved. When you start Outlook, it
complains that the file (the moved pst) cannot be found. If you right
click on the name of the folder in the folder list, and choose "Close
'name.pst'" Outlook will close it. When I try to do the same thing
with RemoveStore, I get an error:
Set oNameSpace = Application.GetNameSpace("MAPI")
Set oFolder = oNameSpace.Folders.Item("nameOfFolder")
'Prompt the user for confirmation
Dim strPrompt
strPrompt = "Are you sure you want to delete the folder?"
If MsgBox(strPrompt, vbYesNo + vbQuestion) = vbYes Then
oNameSpace.RemoveStore oFolder
End If
The error I get is from the oNameSpace.RemoveStore oFolder line and
says:
Error executing script
What is Outlook doing and can I mimic it?
Thanks
Allison
I have run into the scenario in which a pst which was opened using
AddStore was subsequently deleted or moved. When you start Outlook, it
complains that the file (the moved pst) cannot be found. If you right
click on the name of the folder in the folder list, and choose "Close
'name.pst'" Outlook will close it. When I try to do the same thing
with RemoveStore, I get an error:
Set oNameSpace = Application.GetNameSpace("MAPI")
Set oFolder = oNameSpace.Folders.Item("nameOfFolder")
'Prompt the user for confirmation
Dim strPrompt
strPrompt = "Are you sure you want to delete the folder?"
If MsgBox(strPrompt, vbYesNo + vbQuestion) = vbYes Then
oNameSpace.RemoveStore oFolder
End If
The error I get is from the oNameSpace.RemoveStore oFolder line and
says:
Error executing script
What is Outlook doing and can I mimic it?
Thanks
Allison