I'm not sure if this can be done or not... we want to auto forward by rule
email messages during a specific time period... most specifically after
hours... is it possible to create a rule that would forward emails with a
specific criteria during a specific set of hours?
Thanks
--
J_Nettles
'START CODE
Private WithEvents objInboxItems As Items
Private Sub Application_Startup()
Dim objNS As NameSpace
Set objNS = Application.GetNamespace("MAPI")
' instantiate Items collections for folders we want to monitor
Set objInboxItems = objNS.GetDefaultFolder(olFolderInbox).Items
Set objNS = Nothing
End Sub
Private Sub Application_Quit()
' disassociate global objects declared WithEvents
Set objInboxItems = Nothing
End Sub
Private Sub objInboxItems_ItemAdd(ByVal Item As Object)
Dim olItems As Items, _
olItem As Object, _
olMailItem As MailItem, _
olAttachmentItem As Attachment, _
bolTimeMatch As Boolean
Set olItems = objInboxItems.Restrict("[Unread] = True")
For Each olItem In olItems
If olItem.Class = olMail Then
Set olMailItem = olItem
'Change the times on the next line to those you want to use
bolTimeMatch = (Time >= #4:00:00 PM#) And (Time <= #8:30:00 AM#)
If bolTimeMatch Then
Dim objMail As Outlook.MailItem
Set objItem = olMailItem
Set objMail = objItem.Forward
'PUT THE EXTERNAL EMAIL ADDRESS YOU WANT TO USE ON THE NEXT LINE
objMail.To = "your...@yourhost.com"
objMail.Send
Set objItem = Nothing
Set objMail = Nothing
End If
End If
Next
End Sub
Function IsNothing(Obj)
If TypeName(Obj) = "Nothing" Then
IsNothing = True
Else
IsNothing = False
End If
End Function
'END CODE
> On Monday, January 18, 2010 1:06 PM J_Nettles wrote:
> Afternoon All:
>
> I am not sure if this can be done or not... we want to auto forward by rule
> Submitted via EggHeadCafe
> SQL Server CLR Stored Procedures for External Access
> http://www.eggheadcafe.com/tutorials/aspnet/08c40d08-af4a-41f6-9352-91ac82b90078/sql-server-clr-stored-procedures-for-external-access.aspx
> Afternoon All:
>
> I am not sure if this can be done or not... we want to auto forward by rule
>> Submitted via EggHeadCafe
>> LINQ executed in Parallel (PLINQ)
>> http://www.eggheadcafe.com/tutorials/aspnet/042c0b06-95f2-4944-9b52-46be6eeb3e7d/linq-executed-in-parallel-plinq.aspx
> Afternoon All:
>
> I am not sure if this can be done or not... we want to auto forward by rule
>>> Submitted via EggHeadCafe
>>> ASP.NET JSON Cookies and Excel
>>> http://www.eggheadcafe.com/tutorials/aspnet/71b3b844-2aef-4350-8611-bacc8827d022/aspnet-json-cookies-and-excel.aspx