Message box when deleting folder

B

Bina

I have a folder that I have temporarily created in the deleted items folder
in order to display an email message programatically. When I delete this
folder using the following code, a window with the message "Deleting items
from the [Folder Name] folder" pops up. How do I supress this window or at
least minimize it?

Here's the code below:

Dim mOutlookAppl = New Microsoft.Office.Interop.Outlook.Application
mOutlookAppl.GetNamespace("MAPI").Logon()

Dim myfolder As Microsoft.Office.Interop.Outlook.MapiFolder

myFolder = mOutlookAppl.GetNamespace("MAPI").GetDefaultFolder _
(Outlook.OlDefaultFolders.olFolderDeletedItems). _
Folders.Add("My New Folder")

....do some stuff...
myFolder.Delete()

Thanks!
Bina
 
M

Michael Bauer [MVP - Outlook]

That's a setting determined by the user (prompt before deleting items),
which you can't simply turn off. I assume it's stored in the registry; you
could change that setting, but after that you'd have to restart Outlook.

Why do you need a folder to display an item?

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Wed, 11 Mar 2009 08:50:05 -0700 schrieb Bina:
 
B

Bina

The message box does not prompt the user to do anything, it seems to be
informational only.

We are creating a folder because we are importing a message from a .eml file
using Redemption, and we don't want the message to show up in the user's
inbox folder. We create a special temp folder to store these imported
messages, display them using the Outlook API, and then once the user is done
viewing them, we delete the folder and the messages from Outlook, since the
..eml files are stored elsewhere.

Michael Bauer said:
That's a setting determined by the user (prompt before deleting items),
which you can't simply turn off. I assume it's stored in the registry; you
could change that setting, but after that you'd have to restart Outlook.

Why do you need a folder to display an item?

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Wed, 11 Mar 2009 08:50:05 -0700 schrieb Bina:
I have a folder that I have temporarily created in the deleted items folder
in order to display an email message programatically. When I delete this
folder using the following code, a window with the message "Deleting items
from the [Folder Name] folder" pops up. How do I supress this window or at
least minimize it?

Here's the code below:

Dim mOutlookAppl = New Microsoft.Office.Interop.Outlook.Application
mOutlookAppl.GetNamespace("MAPI").Logon()

Dim myfolder As Microsoft.Office.Interop.Outlook.MapiFolder

myFolder = mOutlookAppl.GetNamespace("MAPI").GetDefaultFolder _
(Outlook.OlDefaultFolders.olFolderDeletedItems). _
Folders.Add("My New Folder")

...do some stuff...
myFolder.Delete()

Thanks!
Bina
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top