Macro to set contact reminder to next day 9:00

Status
Not open for further replies.

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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
Thx I will try

Pls can you help me setting
ReminderTime 90 minuter from actual time?
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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
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
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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
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
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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
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
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
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
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
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
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
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
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
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
try setting a due date in the future when you remove the reminder, then set it to none when you add the reminder.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
4 Macro to set the category of Deleted Item? Outlook VBA and Custom Forms 2
R Macro to copy email to excel - Runtime Error 91 Object Variable Not Set Outlook VBA and Custom Forms 11
Q How do I set up macro for adobe Outlook VBA and Custom Forms 1
T Macro to move reply and original message to folder Outlook VBA and Custom Forms 6
D Autosort macro for items in a view Outlook VBA and Custom Forms 1
S HTML to Plain Text Macro - Help Outlook VBA and Custom Forms 1
A Macro to file emails into subfolder based on subject line Outlook VBA and Custom Forms 1
N Help creating a VBA macro with conditional formatting to change the font color of all external emails to red Outlook VBA and Custom Forms 5
S Visual indicator of a certain property or to show a macro toggle Outlook VBA and Custom Forms 2
L Modifying VBA script to delay running macro Outlook VBA and Custom Forms 3
S Macro to extract and modify links from emails Outlook VBA and Custom Forms 3
M Replyall macro with template and auto insert receptens Outlook VBA and Custom Forms 1
L Macro to add Date & Time etc to "drag to save" e-mails Outlook VBA and Custom Forms 8
S Macro for Loop through outlook unread emails Outlook VBA and Custom Forms 2
Globalforester ItemAdd Macro - multiple emails Outlook VBA and Custom Forms 3
S Macro to extract email addresses of recipients in current drafted email and put into clipboard Outlook VBA and Custom Forms 2
witzker HowTo start a macro with an Button in OL contact form Outlook VBA and Custom Forms 12
witzker Macro to move @domain.xx of a Spammail to Blacklist in Outlook 2019 Outlook VBA and Custom Forms 7
S Macro for other actions - Outlook 2007 Outlook VBA and Custom Forms 23
C Macro to extract sender name & subject line of incoming emails to single txt file Outlook VBA and Custom Forms 3
L Macro/VBA to Reply All, with the original attachments Outlook VBA and Custom Forms 2
S Macro to move “Re:” & “FWD:” email recieved the shared inbox to a subfolder in outlook Outlook VBA and Custom Forms 0
S Outlook Macro to send auto acknowledge mail only to new mails received to a specific shared inbox Outlook VBA and Custom Forms 0
S Outlook Macro to move reply mail based on the key word in the subjectline Outlook VBA and Custom Forms 0
Eike Move mails via macro triggered by the click of a button? Outlook VBA and Custom Forms 0
S Macro or plug-in to see if specific person was included in this email Outlook VBA and Custom Forms 4
U Macro for reminders,tasks,calendar Outlook VBA and Custom Forms 4
V macro runs slower on startup than after Outlook VBA and Custom Forms 3
N Macro to move all recipients to CC while replying Outlook VBA and Custom Forms 0
A VBA macro for 15 second loop in send and received just for 1 specific mailbox Outlook VBA and Custom Forms 1
G VBA Macro Using Outlook 4
R Help Revising VBA macro to delete email over different time span Outlook VBA and Custom Forms 0
M Outlook macro to automate search and forward process Outlook VBA and Custom Forms 6
R Macro Schedule every day in Outlook Using Outlook 0
L Moving emails with similar subject and find the timings between the emails using outlook VBA macro Outlook VBA and Custom Forms 1
Healy Consultants Macro to remove inside organization distribution list email address when reply to all recepients Outlook VBA and Custom Forms 0
geofferyh Cannot get Macro to SAVE more than one message attachment??? Outlook VBA and Custom Forms 5
N How can I increase/faster outlook VBA Macro Speed ? Using Outlook 2
D.Moore Folder view settings by VBA macro Outlook VBA and Custom Forms 57
A Outlook macro to create search folder with mail categories as criteria Outlook VBA and Custom Forms 3
Dave A Run macro on existing appointment when it changes Outlook VBA and Custom Forms 1
V Outlook Macro to show Flagged messages Outlook VBA and Custom Forms 2
O Run macro automatically at sending an email Using Outlook 11
R Retain Original Message When Forwarding With Macro Outlook VBA and Custom Forms 3
C Macro to add multiple recipients to message Outlook VBA and Custom Forms 3
B Reply and replyall macro is not working Outlook VBA and Custom Forms 1
O Macro - paste as plain text Outlook VBA and Custom Forms 2
J Help Please!!! Outlook 2016 - VBA Macro for replying with attachment in meeting invite Outlook VBA and Custom Forms 9
M Adding Macro to populate "to" "subject" "body" not deleting email string below. Outlook VBA and Custom Forms 5
E Copying data from e-mail attachement to EXCEL file via macro Outlook VBA and Custom Forms 38

Similar threads

Top