An Outlook question!

BMPeers

New Member
Joined
Nov 5, 2004
Messages
36
Ok, I know this is an excel forum, but there are so many clever people on here, that I am hoping that you can solve this problem and it is VBA related.

At the moment I can either select that sent messages can either be saved automatically into the sent folder or not.

Is it possible to be prompted after each mail with a message box, asking you whether you do or don't want it saved?

Thanks Brian
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
managed to find the answer, just in case anyone wants to do this as well!
pop this in your outlook session in vba in outlook.


Private Sub Application_ItemSend(ByVal Item As Object, _
Cancel As Boolean)
Item.Categories = ""
If Item.Class = olMail Then
Call CheckToSave(Item)
End If
End Sub

' this sub can be installed anywhere

Sub CheckToSave(objMail As MailItem)

Dim Msg, Style, Title, Response, MyString
Msg = "Do you want to save a copy of this email?" ' Define message.
Style = vbSystemModal + vbYesNo + vbQuestion + vbDefaultButton1 ' Define buttons.
Title = "Mailbox Control" ' Define title.

' Display message.
Response = MsgBox(Msg, Style, Title)

If Response = vbYes Then ' User chose Yes.
objMail.DeleteAfterSubmit = False
Else ' User chose No.
objMail.DeleteAfterSubmit = True
End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,224,847
Messages
6,181,315
Members
453,032
Latest member
Pauh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top