Message box when deleting folder

Status
Not open for further replies.
Q

QmluYQ

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
 
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

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
 
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 " wrote:



> 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

> > >

> 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

>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
S Custom yes/no message box. Using Outlook 0
M Preventing conversation from moving to the top of the message box? Using Outlook 7
M Search message, then (1) Jump to folder & (2) Select message that you searched for Outlook VBA and Custom Forms 2
Kika Melo How to mark as Junk any message not from Contacts (in Outlook.com) Using Outlook 3
G Outlook 365 My iCloud Outlook doesn’t work after reinstalling Microsoft365 on Windows 10 PC – now I get error message on contacts and calendar Using Outlook 1
G Get current open draft message body from VBA Outlook VBA and Custom Forms 1
E Outlook 365 Save Selected Email Message as .msg File - oMail.Delete not working when SEARCH Outlook VBA and Custom Forms 0
HarvMan Outlook 365 - Rule to Move an Incoming Message to Another Folder Using Outlook 4
F Outlook 2019 Forwarding Message and Keeping Unread Status Outlook VBA and Custom Forms 0
E Save Selected Email Message as .msg File - digitally sign email doesn't works Outlook VBA and Custom Forms 1
C Populate form data into message body Outlook VBA and Custom Forms 1
J Outlook 365 Add keywords from Listbox to the message body where cursor is placed Outlook VBA and Custom Forms 0
B How to create a button that sorts and selects the most recent message with ONE click Using Outlook 2
P "Item could not be moved" message occurs frequently for IMAP inbox, Office 365 Using Outlook 0
A rule name into message - how? Outlook VBA and Custom Forms 5
A Links in email getting error message about group policy Using Outlook 4
O How to find and replace a word in Outlook-Agenda-Subject and Message? Using Outlook 0
X Open Hyperlinks in an Outlook Email Message (Help with Diane's solution) Outlook VBA and Custom Forms 3
Commodore Unable to move message Using Outlook 3
Y Disable Microsoft Outlook Test Message Using Outlook 4
S Unable to change Message Class Outlook VBA and Custom Forms 0
S Changing Message Class Outlook VBA and Custom Forms 4
Cathy Rhone Mail merge error message Using Outlook 1
C Can't Locate an Unread Message in my Outlook view pane Using Outlook 0
G Send a greeting message to a contact on birthday Outlook VBA and Custom Forms 5
B Inconsistent handling of message read/unread status by Outlook Using Outlook 3
N Save Selected Email Message as .msg File Outlook VBA and Custom Forms 12
T Macro to move reply and original message to folder Outlook VBA and Custom Forms 6
O Outlook 2010 Add delete button to the side of the message list Using Outlook 1
Cathy Rhone The properties of the message have been changed Using Outlook 1
S Outlook 2016 A Shortcut to recall and delete and sent message. Using Outlook 1
T vba extract data from msg file as attachment file of mail message Outlook VBA and Custom Forms 1
S Unable to extract text from an Outlook email message Using Outlook 2
R Outlook 2016 Message-ID oddity/inconsistency? Using Outlook 7
J Implement Keywords based on body message Outlook VBA and Custom Forms 0
C must select message to trigger safe list Using Outlook 3
Witzker HowTo Change message Class of contact form Outlook VBA and Custom Forms 0
D.Moore VB script to Digitaly Sign newly created outlook message Outlook VBA and Custom Forms 2
O VBA Outlook Message Attachment - Array Index Out of Bounds Outlook VBA and Custom Forms 0
W September 2020 - No Default Email Client message after Office Update Using Outlook 1
A Flag Message for Follow Up after sending Outlook VBA and Custom Forms 1
S Outlook (2016 32bit; Gmail IMAP) - Save sent message to Outllook Folder Outlook VBA and Custom Forms 0
C Why won't Title display in message list? Using Outlook 1
icacream content in this message could not be downloaded.... Using Outlook 2
J Outlook 2016 After a search in all mailboxes, where is each message that was found? Using Outlook 6
R Warn before sending message Outlook VBA and Custom Forms 4
T Column to display which email alias a message was sent to Outlook VBA and Custom Forms 6
V Change start time based on message duration Outlook VBA and Custom Forms 2
J Message search and edit, another way? Outlook VBA and Custom Forms 4
N VBA to delete duplicates by message-id on common pst for 2 or more emails Outlook VBA and Custom Forms 0

Similar threads

Back
Top