Prompt before sending contacts to Deleted Items folder

Status
Not open for further replies.

infotech

Member
Is there a way to enable a prompt when attempting to delete a contact? At the current time, if I delete a contact, it zips away to the Deleted Items folder with no prompt. It is essential that a prompt is displayed before deleting the files. This is for the CEO of the company I work for. He wants to avoid any chance of deleting business contacts by accident. Whether there is a setting for this or some sort of macro, as long as the issue is resolved, he will be happy and so will I. Thank you for any help you may be able to offer.




Note: Even if there is a macro that displays a message after the contact is sent to the deleted items folder and then either moves it back to the origin or leaves it to rot would work. Unfotunately, I have no experience with writing macros :/
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Outlook doesn't offer an 'are you sure' prompt, but you can prompt with VBA. You'll use something like this (but i didn't test it yet to verify it works):


Private Sub Application_BeforeDelete(ByVal Item As Object, Cancel As Boolean)


'Prompts the user before deleting an item


Dim strPrompt As String


'Prompt the user for a response


strPrompt = "Are you sure you want to delete the item?"


If MsgBox(strPrompt, vbYesNo + vbQuestion) = vbNo Then


'Don't delete the item


Cancel = True


End If


End Sub
 

infotech

Member
Thank you for the response! Is there a way to make this macro run when someone deletes a contact from just the Shared Contacts folder? I'm new to macros so I really have no idea if this code will work under our circumstances. Thanks again!

Outlook doesn't offer an 'are you sure' prompt, but you can prompt with VBA. You'll use something like this (but i didn't test it yet to verify it works):

Private Sub Application_BeforeDelete(ByVal Item As Object, Cancel As Boolean)
'Prompts the user before deleting an item
Dim strPrompt As String
'Prompt the user for a response
strPrompt = "Are you sure you want to delete the item?"
If MsgBox(strPrompt, vbYesNo + vbQuestion) = vbNo Then
'Don't delete the item
Cancel = True
End If

End Sub
 

Cathy Rhone

Senior Member
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server 2010
I don't think so, but either this macro isn't quite right or it doesn't work in Outlook 2010.




Is the shared folder a public folder or a contacts folder from someone else's mailbox? You could configure permissions so people can only delete contacts they added or not delete any.
 

infotech

Member
I managed to get the code working with some modifications:

Sub delete()

Dim Cancel As Boolean

Dim strPrompt As String

'Prompt the user for a response

strPrompt = "Are you sure you want to delete the item(s)?"

If MsgBox(strPrompt, vbYesNo + vbQuestion) = vbNo Then

SendKeys ("^z")

'Don't delete the item

Cancel = True

End If

End Sub

I would like to find a way to get this to work now when you actually attempt to delete a contact. It can be in any of the contact folders for that matter. We just need this prompt setup to run when a file is deleted...Hopefully this is possible.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I haven't tried your code yet, but it should only work when you use the delete command on an open message, not with the delete key or delete command when viewing in the contacts folder.
 

infotech

Member
That's correct. I would really like to get it working for the entire folder though. Is that possible? Also, what has to be done for the macro to run from the time Outlook opens? Sorry if these questions are elementary. I have tried Googling and there's an overwhelming amount of results, mostly irrelevant to my queries...Thanks for any help you may offer!




I haven't tried your code yet, but it should only work when you use the delete command on an open message, not with the delete key or delete command when viewing in the contacts folder.
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
S Prompt to add for text to existing subject line before sending. Using Outlook 9
S Trying to have a prompt to ask for text to be added to subject before sending. Using Outlook 3
C Is there a way to prompt a user before deleting an item? BCM (Business Contact Manager) 4
T Outlook 2010 Setting to Prompt 'Send before Exiting'__ Using Outlook 2
Q Prompt button to auto turn on Out of Office Outlook VBA and Custom Forms 3
R Prompt asking the user to send email to folder as *.msg file Outlook VBA and Custom Forms 1
R Make Enter Network Password Prompt Go Away Automatically Using Outlook 0
K VBA to prompt and send a CC Outlook VBA and Custom Forms 6
K VBA - Prompt for reminder date time Outlook VBA and Custom Forms 7
S Have Rule or Quick Step PROMPT for custom FLAG Due/Reminder date Outlook VBA and Custom Forms 3
P Constant Username Password Prompt Using Outlook 2
A Prompt on exit to empty deleted items folder "for all accounts" does not work? Using Outlook 6
N Prompt for password when sending an email Exchange Server Administration 1
O How to turn off the prompt to permanently delete messages upon exiting? Using Outlook 2
G Outlook keep prompt for log in credential Using Outlook 1
J Deactivate MS Outlook 2007 prompt to make it the default email client Using Outlook 1
O Outlook 2007 SP2 Prompt for Password Exchange Server Administration 3
R Does not prompt for saving or opening attachments when downloading attachment in Outlook 2007. Using Outlook 3
S Continuous password and username prompt in outlook 2007 Using Outlook 1
E Enter Network Password prompt does not accept my password Using Outlook 4
B Password prompt for the pst files Using Outlook 9
O OWA 2003 prompt to re-auntenticate when opening up office attachments Using Outlook 10
L outlook 2007 login prompt from old exchange host Using Outlook 3
B outlook 2007 password prompt keeps popping up Using Outlook 1
M Outlook 2007 and Outlook 2010 continues to prompt user for their password Using Outlook 7
E Users get login prompt in Outlook 2007 when accessing Exchange Server 2007 Using Outlook 2
D Credentials Prompt Exchange Server Administration 1
L Strange macro prompt Using Outlook 1
C outlook clients prompt for a password each time it open Exchange Server Administration 2
S exchange 2010 e-mail user password expiration prompt Exchange Server Administration 8
S After installing 3rd party Certificate for IIS , prompt warning for mapi clients the name on security certificate is invalid , Exchange Server Administration 3
S cross post please read: Exchange Account password prompt in Outlook 2010 Using Outlook 2
S How to add multiple exchange accounts without password / credential prompt? Using Outlook 5
J Enable prompt to save/open attachment Using Outlook 1
C Reboot a CAS array member causes Outlook 2010 clients to prompt for credentials. Using Outlook 5
O Password Prompt in Outlook 2003 Using Outlook 4
S cannot get past OWA login prompt Using Outlook 4
J Outlook 2003 Calendar Meeting NO Cancellation Prompt Using Outlook 1
F lI get a Enter Network Password prompt. It doesn't like my password and keeps coming up repeatedly. I have Knowledge Base article 290684 and tried t Using Outlook 2
J Hardcode domain into outlook credential prompt. Exchange Server Administration 1
P Windows 7 looses Outlook 2007 email profile prompt - can't access my other email account. Using Outlook 1
S Prompt when sending to Distribution List Exchange Server Administration 3
J Log in prompt when clicking on a https link Exchange Server Administration 1
G prompt for network password Using Outlook 1
M Email Prompt Outlook VBA and Custom Forms 1
T Prompt for email account Outlook VBA and Custom Forms 1
P Outlook security prompt after installing Add-in Outlook VBA and Custom Forms 3
Q Otlk 2007 does not block when in "always prompt for..." mode Outlook VBA and Custom Forms 2
Q sending mail when Otlook in 'always prompt for user name and passw Outlook VBA and Custom Forms 4
J Outlook 2007 Clients Prompt For Password When Opening Using Outlook 21
Similar threads


















































Top