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.
Similar threads
Thread starter Title 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
C VBA to prompt for Sent folder destination Outlook VBA and Custom Forms 3
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
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
O Create a custom contact form - questions before messing things up... Outlook VBA and Custom Forms 4
L unblocking attachments before sending Office 365 Advanced Protection Using Outlook 0
PGSystemTester VBA To Change AppointmentItem.BusyStatus From MeetingItem Before Send Using Outlook 0
R Warn before sending message Outlook VBA and Custom Forms 4
W Outlook 2010 some sent items marked unread now (was Ok before) Using Outlook 0
M Auto expand Distribution List Before Sending Email Outlook VBA and Custom Forms 1
M Moving mail to another folder is much slower than before (Office365) Using Outlook 0
A Check for words in subject header before sending email Outlook VBA and Custom Forms 4
CWM030 Rules disappearing in OL 2016? ( Yes, I searched before posting) Using Outlook 7
U Outlook 2010 'freezes' before moving emails Using Outlook 2
S Mail filter recieved before the last 2 working days Using Outlook 1
copperberry How to display incomplete tasks due on or before 7 days from now Using Outlook 0
O Rules and Alerts for New Messages BEFORE sending Using Outlook 2
G Can't open .pst. Message could not access default folder (Outlook 2010 (.pst). Before that was backi Using Outlook 0
Diane Poremsky Select from a List of Subjects before Sending a Message New Slipstick.com Articles 0
Diane Poremsky Check Contacts before moving them to Hotmail Contacts folder New Slipstick.com Articles 0
Diane Poremsky Check for missing attachments before sending a message New Slipstick.com Articles 1
Diane Poremsky Warn before sending messages to the wrong email address New Slipstick.com Articles 1
J How to validate any email address before it is sent Using Outlook 2
K Problem with FreeBusy (before 1pm only) Outlook VBA and Custom Forms 7
Diane Poremsky Add Attachment Names to Message Before Sending New Slipstick.com Articles 0
Diane Poremsky Check Message Size Before Sending New Slipstick.com Articles 0
Diane Poremsky Add Secure to the Message Subject before Sending New Slipstick.com Articles 0
J Creating a URL from a message body excerpt before forwarding Using Outlook 2

Similar threads

Top