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.
Thread starter Similar threads 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
S Macro or plug-in to see if specific person was included in this email Outlook VBA and Custom Forms 3
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 Calendar Printing Assistant 3
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
M Macro to add date/time stamp to subject Outlook VBA and Custom Forms 4
R VBA macro - new message Outlook VBA and Custom Forms 3
S Example VBA Macro - To Conditionally Change the From Account and Add a BCC Address on Emails Outlook VBA and Custom Forms 11
S Macro using .SendUsingAccount only works the first time, after starting Outlook Outlook VBA and Custom Forms 4
S VBA Macro - Run-time error '424': object required - Help Please Outlook VBA and Custom Forms 3
B VBA Macro for assigning multiple Categories to an email in my Inbox Outlook VBA and Custom Forms 1
N Macro for attachment saved and combine Outlook VBA and Custom Forms 1
Sabastian Samuel HOW DO I FORWARD AN EMAIL WITH MACRO using an email that in the body of another email Outlook VBA and Custom Forms 3
C Search with Google Macro? Outlook VBA and Custom Forms 4
J Outlook 2013 Extract Flag Completed dates to Excel Macro Outlook VBA and Custom Forms 16
M Slow VBA macro in Outlook Outlook VBA and Custom Forms 5
D Print Attachments only in selected emails using a macro Outlook VBA and Custom Forms 3
M Macro for attachments download adjustment Outlook VBA and Custom Forms 3
M VBA macro for Inbox's attachments search Outlook VBA and Custom Forms 0
B Macro to manually move selected emails to network folder Outlook VBA and Custom Forms 1
A Forward Outlook Email by Filtering using Macro Rule Outlook VBA and Custom Forms 44
I Dialog called up multiple times when saving emails from macro Outlook VBA and Custom Forms 2
Y VBA Macro to highlight some Keyword in mail body? Outlook VBA and Custom Forms 3
Tanja Östrand Outlook 2016 - Create Macro button to add text in Subject Outlook VBA and Custom Forms 1
D Outlook macro with today's date in subject and paste clipboard in body Outlook VBA and Custom Forms 1
nathandavies Email Details to Excel & Save as .MSG on one macro - combination of 2 macros Outlook VBA and Custom Forms 3
C Outlook Subject Line Macro Outlook VBA and Custom Forms 0
Similar threads


















































Top