UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Arrangment With Code    
 
   
raphael99
post Nov 11 2015, 04:02 AM
Post#1



Posts: 117
Joined: 24-May 15



Hi
I'm implementing a rule which send a response vacation mail to sender.

I have:
CODE
Sub MoveMeIfNecessary(Item As Outlook.MailItem)
  On Error Resume Next

  Dim wd As Integer
  Dim h As Integer
  
  wd = Weekday(Date) 'week day: Sunday =1, Monday= 2, ....
  h = Hour(Time)     'Hour: 24 hour format (0-23)
  
  If (wd = 5 Or wd = 7 Or wd = 8 Or h > 20 Or h < 8) Then
  Item.Move GetFolderByName("My Folder")
  Item.Save
  End If
  
End Sub


I would like implement the code in this way:
Monday h 8 to 20 = No mail vacation reply
Tuesday h 8 to 20 = No mail vacation reply
Wendney h 8 to 20 = No mail vacation reply

Thursday full 24 hours = mail vacation reply

Friday h 8 to 20 = No mail vacation reply

Saturday h 8 to 10 = No mail vacation reply

Saturday h 10.00 to 24.00 = mail vacation reply

Sunday full 24 hours= mail vacation reply

Can someone helps?
Thanks
Go to the top of the page
 
Jeff B.
post Nov 11 2015, 06:14 AM
Post#2


UtterAccess VIP
Posts: 9,884
Joined: 30-April 10
From: Pacific NorthWet


If there is any chance those 'windows' will be altered (e.g., new business rules), I'd suggest putting the day-of-week and time-of-day (from; to) in a table. That way, the changes are a simple table change.
The rest of the story is matching a target date/time you have to the table values to find the appropriate (email/not) action.
Go to the top of the page
 
raphael99
post Nov 11 2015, 08:02 AM
Post#3



Posts: 117
Joined: 24-May 15



I cannot put a table down. I'm working with a macro visual basic code.
I would like to have a simple exaple how to put it down. Have found nothing on net.
Can you help?
Go to the top of the page
 
Jeff B.
post Nov 12 2015, 08:42 AM
Post#4


UtterAccess VIP
Posts: 9,884
Joined: 30-April 10
From: Pacific NorthWet


I don't know enough to have a clear picture of your situation. Why is it not possible to create a table to store those conditions? Why must you work with macros?
Go to the top of the page
 
raphael99
post Nov 14 2015, 06:11 AM
Post#5



Posts: 117
Joined: 24-May 15



Sorry for to be late in response. I opted for a mailserver provider solution. Thanks for your suggestion
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    15th December 2017 - 08:35 PM