![]() |
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 |
|
#1
|
|||
|
|||
![]()
I've read the help on reply event , but can't get it to work
I've tried placing this everywhere but I can't get it to run when the user sends a reply. I'm trying to find the right place to set the code so that only runs when the user sends a reply PLEASE can anyone help Public WithEvents myItem As MailItem Sub Initialize_Handler() Set myItem = Application.ActiveInspector.CurrentItem End Sub Private Sub myItem_Reply(ByVal Response As Object, Cancel As Boolean) MsgBox "Reply" End Sub |
#2
|
|||
|
|||
![]()
We're confused, too. You've posted in a forum about Outlook custom forms, which use VBScript as their code language, but the topic of your post seems to deal with VBA/VB code. Please give us the "big picture" so we can understand what you're trying to do.
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "SuperSlueth" wrote in message ... I've read the help on reply event , but can't get it to work I've tried placing this everywhere but I can't get it to run when the user sends a reply. I'm trying to find the right place to set the code so that only runs when the user sends a reply PLEASE can anyone help Public WithEvents myItem As MailItem Sub Initialize_Handler() Set myItem = Application.ActiveInspector.CurrentItem End Sub Private Sub myItem_Reply(ByVal Response As Object, Cancel As Boolean) MsgBox "Reply" End Sub |
#3
|
|||
|
|||
![]()
I have users that get faxes as email attachments.
Sometimes as many as 6 or 7 per email, as GIF attachments. Outlook 2003 doesn't allow you to open multiple attachments at 1 time. I'm trying to write a VBA macro that opens all the attachments when the user opens the email. I don't want to open the attachments when the user uses Reply, Reply All, or Forward. So I need to test for these and block those events I only want to open the attachments when the user opens the eamil to read. All the code I've seen on the interent either opens attachments on new mails as they come in or search the inbox for attachments and opens them all Maybe you have a simple solution to this seemingly easy task On Tue, 21 Feb 2006 08:58:35 -0500, "Sue Mosher [MVP-Outlook]" wrote: We're confused, too. You've posted in a forum about Outlook custom forms, which use VBScript as their code language, but the topic of your post seems to deal with VBA/VB code. Please give us the "big picture" so we can understand what you're trying to do. |
#4
|
|||
|
|||
![]()
Take a look at http://www.outlookcode.com/codedetail.aspx?id=1140. Check the message's Sent property equals False, then you know you have a reply, forward, or new message.
Note that this has nothing to do with custom forms. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "SuperSlueth" wrote in message ... I have users that get faxes as email attachments. Sometimes as many as 6 or 7 per email, as GIF attachments. Outlook 2003 doesn't allow you to open multiple attachments at 1 time. I'm trying to write a VBA macro that opens all the attachments when the user opens the email. I don't want to open the attachments when the user uses Reply, Reply All, or Forward. So I need to test for these and block those events I only want to open the attachments when the user opens the eamil to read. All the code I've seen on the interent either opens attachments on new mails as they come in or search the inbox for attachments and opens them all Maybe you have a simple solution to this seemingly easy task On Tue, 21 Feb 2006 08:58:35 -0500, "Sue Mosher [MVP-Outlook]" wrote: We're confused, too. You've posted in a forum about Outlook custom forms, which use VBScript as their code language, but the topic of your post seems to deal with VBA/VB code. Please give us the "big picture" so we can understand what you're trying to do. |
#5
|
|||
|
|||
![]()
The code that you suggested, when does it run ....
I mean does the user have to do something or does this code run when a new mail comes in. The users here don't want the attachments for every mail to open. only when the user opens it to read. Quite often we get unwanted or duplicate mails with attachements ... the user just wants to delete these without the attachments opening Thanks for you continued help I've included my code for your information This is the code so far Code in "ThisOutlookSession" Dim WithEvents colInsp As Outlook.Inspectors Public WithEvents myItem As Outlook.MailItem Private Sub colInsp_NewInspector(ByVal Inspector As Inspector) Call Att_Open End Sub Code in Module .... It runs fine when an email is opened to read, but also runs when the user selects Reply. ReplyAll forward or New .... which i need to stop Sub Att_Open() Dim myolApp As Outlook.Application Dim myinspector As Outlook.Inspector Set myolApp = CreateObject("Outlook.Application") Set myinspector = myolApp.ActiveInspector Dim I As Integer If TypeName(myinspector) = "Nothing" Then Exit Sub ElseIf Application.ActiveInspector.CurrentItem.Attachment s.Count = 0 Then MsgBox "No Attachments" ElseIf Application.ActiveInspector.CurrentItem.Attachment s.Count 0 Then I = Application.ActiveInspector.CurrentItem.Attachment s.Count MsgBox I End If End Sub On Tue, 21 Feb 2006 11:53:32 -0500, "Sue Mosher [MVP-Outlook]" wrote: Take a look at http://www.outlookcode.com/codedetail.aspx?id=1140. Check the message's Sent property equals False, then you know you have a reply, forward, or new message. Note that this has nothing to do with custom forms. |
#6
|
|||
|
|||
![]()
I don't see any code yet to instantiate colInsp. If you want the whole routine to run automatically, you need code in the Application_Startup event handler in ThisOutlookSession to handle that.
As I said in my earlier post, if you check the value of the message's Sent property and it equals False, then you know you have a reply, forward, or new message, one that you don't want to process. Other issues: Outlook VBA includes an intrinsic Application object, so you don't need to use CreateObject to create another one. Also, you said "users." Outlook VBA code is not meant to be redistributed. Ultimately, you should be thinking about building this functionality into an OUtlook COM add-in. See http://www.outlookcode.com/d/comaddins.htm -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "SuperSlueth" wrote in message ... The code that you suggested, when does it run .... I mean does the user have to do something or does this code run when a new mail comes in. The users here don't want the attachments for every mail to open. only when the user opens it to read. Quite often we get unwanted or duplicate mails with attachements ... the user just wants to delete these without the attachments opening Thanks for you continued help I've included my code for your information This is the code so far Code in "ThisOutlookSession" Dim WithEvents colInsp As Outlook.Inspectors Public WithEvents myItem As Outlook.MailItem Private Sub colInsp_NewInspector(ByVal Inspector As Inspector) Call Att_Open End Sub Code in Module .... It runs fine when an email is opened to read, but also runs when the user selects Reply. ReplyAll forward or New .... which i need to stop Sub Att_Open() Dim myolApp As Outlook.Application Dim myinspector As Outlook.Inspector Set myolApp = CreateObject("Outlook.Application") Set myinspector = myolApp.ActiveInspector Dim I As Integer If TypeName(myinspector) = "Nothing" Then Exit Sub ElseIf Application.ActiveInspector.CurrentItem.Attachment s.Count = 0 Then MsgBox "No Attachments" ElseIf Application.ActiveInspector.CurrentItem.Attachment s.Count 0 Then I = Application.ActiveInspector.CurrentItem.Attachment s.Count MsgBox I End If End Sub On Tue, 21 Feb 2006 11:53:32 -0500, "Sue Mosher [MVP-Outlook]" wrote: Take a look at http://www.outlookcode.com/codedetail.aspx?id=1140. Check the message's Sent property equals False, then you know you have a reply, forward, or new message. Note that this has nothing to do with custom forms. |
Thread Tools | Search this Thread |
Display Modes | |
|
|