Macro to set contact reminder to next day 9:00

Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#21
they should still be red if over due - but you might need to create a custom view that uses conditional formatting.
 

witzker

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
#22
Thx I will try

Pls can you help me setting
ReminderTime 90 minuter from actual time?
 
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#23
Thx I will try

Pls can you help me setting
ReminderTime 90 minuter from actual time?
As in 90 min from now or 90 min before due? Either is possible...

90 from now...
.ReminderTime = Now() + 90 / 1440

Tasks don't have a due time, only a due date, so this ends up being 1:30 AM. :( It would work with reminders on appointments.
.ReminderTime = .DueDate + 90 / 1440
 

witzker

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
#24
THX
works great.

To get the macro "tomorrow 09.00 a.m." more comfortable for using it on Fridays
(when I click on tomorrow 09.00 on Friday it will remind me on Saturday where I cannot call)

How can I modify the macro when I use it on Friday or Saturday, that it will set reminder time to next Monday 09.00 a.m..

Code:
Public Sub Morgen09()
Dim objMsg As Object
' GetCurrent Item function is athttp://slipstick.me/e8mio
Set objMsg = GetCurrentItem()
With objMsg
' due this week flag
    .MarkAsTask olMarkNoDate
    .MarkAsTask olMarkComplete
' sets a specific due date
    '.TaskDueDate = Now + 3
    '.FlagRequest = "Nachverfolgung"
    .ReminderSet = True
    .ReminderTime = Date + 1 + #9:00:00 AM#
    .Save
End With

Set objMsg = Nothing
End Sub
Many thanks for your further help

Witzker
 
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#25
it will read something like this - i think the bolded part is correct but did not test it.
if format (date,"dddd") = "Friday" then
.ReminderTime = Date + 3 + #9:00:00 AM#
else
.ReminderTime = Date + 1 + #9:00:00 AM#

end if
 

witzker

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
#26
THX
I think I did something wrong
I get SYNTAX error

Code:
Public Sub Morgen09()
Dim objMsg As Object
' GetCurrent Item function is athttp://slipstick.me/e8mio
Set objMsg = GetCurrentItem()
With objMsg
' due this week flag
    .MarkAsTask olMarkNoDate
    .MarkAsTask olMarkComplete
' sets a specific due date
    '.TaskDueDate = Now + 3
    '.FlagRequest = "Nachverfolgung"
    .ReminderSet = True
 
If format(date,"dddd") = "Friday" then
.ReminderTime = Date + 3 + #9:00:00 AM#
else
.ReminderTime = Date + 1 + #9:00:00 AM#
End If

.Save
End With

Set objMsg = Nothing
End Sub
 
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#27
It's working here. You probably don't want this line as it sets it to complete, but that isn't callusing an error:
.MarkAsTask olMarkComplete

Are any lines shown in red? Does it say which line has the error?

The date format is working...
2018-05-25_11-00-23.png
 

witzker

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
#28
Hi
This line is red
If format(date,"dddd") = "Friday" then

Its a german Outlook mayby I have say Freitag instead of Friday?
 

witzker

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
#31
Hi again

Back to another problem.

You wrote:
It's working here. You probably don't want this line as it sets it to complete, but that isn't callusing an error:
.MarkAsTask olMarkComplete


You are right, I do not want to have it marked as complete, so I removed this line.

Code below

When I now run the macro without the line on a contact, where reminder was set before and the date is due (red in the view) it updates reminder time but still stays red in the view, although the reminder date is in the future.

When I open a contact where reminder was set before and the date is due (red in the view) and I delete the reminder as seen below
1528295394836.png


and afterwards run the macro, contact is correct NOT red with updated reminder in the future.

To save this step I think I should put the code for "deleting reminder (Kennzeichnung löschen" in the macro before setting the new reminder time.

I hope you can help me to get it finally running.

Thanks
Code:
Public Sub HeuteTest()
Dim objMsg As Object
' GetCurrent Item function is athttp://slipstick.me/e8mio
Set objMsg = GetCurrentItem()
With objMsg
' due this week flag
    .MarkAsTask olMarkNoDate
    '.MarkAsTask olMarkComplete
    ' sets a specific due date
     '.TaskDueDate = Date + #12:31:00 PM#
     '.FlagRequest = "Nachverfolgung"
    
    ' makes sure due date is none
    .TaskDueDate = #1/1/4501#
              
    .ReminderSet = True
    .ReminderTime = Now() + 2 / 1440
    
     .Save
End With

Set objMsg = Nothing
End Sub

Function GetCurrentItem() As Object
    Dim objApp As Outlook.Application
           
    Set objApp = Application
    On Error Resume Next
    Select Case TypeName(objApp.ActiveWindow)
        Case "Explorer"
            Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
        Case "Inspector"
            Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
    End Select
       
    Set objApp = Nothing
End Function
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#32
Yeah, definitely try setting the reminder to none first- but you'll probably need to add a .save right after, so it "takes".
 

witzker

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
#33
tried This
Public Sub HeuteTest()
Dim objMsg As Object
' GetCurrent Item function is athttp://slipstick.me/e8mio
Set objMsg = GetCurrentItem()
With objMsg
' due this week flag
.MarkAsTask olMarkNoDate
'.MarkAsTask olMarkComplete
' sets a specific due date
'.TaskDueDate = Date + #12:31:00 PM#
'.FlagRequest = "Nachverfolgung"

' makes sure due date is none
.TaskDueDate = #1/1/4501#

.ReminderSet = none ' added no result!
.Save

.ReminderSet = True
.ReminderTime = Now() + 2 / 1440

.Save
End With

Set objMsg = Nothing
End Sub

still red
can you pls tell me how to set reminder to none
THX
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#34
Oh... my bad - i was thinking this set it to none:
' makes sure due date is none
.TaskDueDate = #1/1/4501#

Try this - I'm not sure if both are needed. (Will test it next)
.ReminderTime = #1/1/4501#
.ReminderSet = False
.Save
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#35
This seems to work - i didn't have a lot of contacts to test it on though.
Code:
.ReminderTime = #1/1/4501#
.ReminderSet = False
.Save
 

witzker

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
#36
THX but sorry
Still RED

Public Sub HeuteTest()
Dim objMsg As Object
' GetCurrent Item function is athttp://slipstick.me/e8mio
Set objMsg = GetCurrentItem()
With objMsg
' due this week flag
.MarkAsTask olMarkNoDate
'.MarkAsTask olMarkComplete
' sets a specific due date
'.TaskDueDate = Date + #12:31:00 PM#
'.FlagRequest = "Nachverfolgung"

' makes sure due date is none
.TaskDueDate = #1/1/4501#

'Try this - I 'm not sure if both are needed. (Will test it next)
.ReminderTime = #1/1/4501#
.ReminderSet = False
.Save ' still RED !
' setting correct reminder
.ReminderSet = True
.ReminderTime = Now() + 2 / 1440

.Save
End With

Set objMsg = Nothing
End Sub
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#38
There is a Library "IMContact" in OL ist this helpful?
I have no idea what that is... oh - smart tags (based on the file path). I don't think its used anymore.

The code sample from VBOffice won't work in modern versions of Outlook - it uses CDO to set the flags. Modern versions don't use CDO.
 

witzker

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
#39
OK THX
How to go on the contact is still red in the code above?
Hope for help
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#40
try setting a due date in the future when you remove the reminder, then set it to none when you add the reminder.
 
Top