![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
#11
|
|||
|
|||
![]()
I was able to get the VBA Send Capture to work, but now I want to add some
filtering Here is my copy for filtering one address, but I want to filter Multiple addresses Private Sub Application_Startup() End Sub Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim prompt As String If Item.To = "TestDistList" Then prompt = "Are you sure you want to send " & Item.To & "?" If MsgBox(prompt, vbYesNo + vbExclamation, "Sample") = vbNo Then Cancel = True End If Else End If End Sub "Ken Slovak - [MVP - Outlook]" wrote: No. It would be in the ThisOutlookSessionClass, you would never create an Outlook.Application object (you use the intrinsic Application object) and you use Application_Startup, as I said before. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Mike "YO_BEE" B" wrote in message ... would it be something like this under the Class Modules ? Public Sub Startup() Set myOlApp = CreateObject("Outlook.Application") End Sub Private Sub myOlApp_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim prompt As String prompt = "Are you sure you want to send " & "?" If MsgBox(prompt, 4 + 16, "This is a Warning!") = vbNo Then Cancel = True End If End Sub |
Ads |
#12
|
|||
|
|||
![]()
So what's the question? If you want to filter on multiple email names or
addresses you will have to extend what you're doing now to handle all those names or addresses. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Mike "YO_BEE" B" wrote in message ... I was able to get the VBA Send Capture to work, but now I want to add some filtering Here is my copy for filtering one address, but I want to filter Multiple addresses Private Sub Application_Startup() End Sub Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim prompt As String If Item.To = "TestDistList" Then prompt = "Are you sure you want to send " & Item.To & "?" If MsgBox(prompt, vbYesNo + vbExclamation, "Sample") = vbNo Then Cancel = True End If Else End If End Sub |
#13
|
|||
|
|||
![]()
I am not sure how to go about extending my search parameters
"Ken Slovak - [MVP - Outlook]" wrote: So what's the question? If you want to filter on multiple email names or addresses you will have to extend what you're doing now to handle all those names or addresses. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Mike "YO_BEE" B" wrote in message ... I was able to get the VBA Send Capture to work, but now I want to add some filtering Here is my copy for filtering one address, but I want to filter Multiple addresses Private Sub Application_Startup() End Sub Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim prompt As String If Item.To = "TestDistList" Then prompt = "Are you sure you want to send " & Item.To & "?" If MsgBox(prompt, vbYesNo + vbExclamation, "Sample") = vbNo Then Cancel = True End If Else End If End Sub |
#14
|
|||
|
|||
![]()
If Item.To = "TestDistList" Then
ElseIf Item.To = "whateverElse" Then etc. Or a Case...Select block, or a set of If's joined by OR clauses: If Item.To = "TestDistList" OR Item.To = "Whatever" Then There are lots of ways to test for more than 1 condition. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Mike "YO_BEE" B" wrote in message ... I am not sure how to go about extending my search parameters |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
ItemSend Event | Catalin | Outlook and VBA | 4 | January 17th 08 08:17 PM |
Capture Outlook 2007 Item Send Event | apondu | Add-ins for Outlook | 0 | December 11th 07 08:45 AM |
Cancelling and closing a mailitem in itemsend event | bstrum | Add-ins for Outlook | 1 | June 19th 07 06:53 AM |
Write RTF-Body on ItemSend event | Thomas | Add-ins for Outlook | 2 | February 12th 07 12:22 PM |
ItemSend event differences betweek W2K & WXP | Lionel H | Outlook and VBA | 4 | October 20th 06 04:16 PM |