Send outlook reminders to multiple recipients (1 Viewer)

bruceblack

Registered User.
Local time
Today, 11:08
Joined
Jun 30, 2017
Messages
119
Hello everyone.

I have a form with a button that has the code below under it.
I'm sending an outlook reminder to myself with it. Work perfectly fine.

But, how can i send it to multiple users?
I searched around and no solution seems to work.
Also do i need a special reference for this?

Cheers!

Code:
Private Sub Command35_Click()

Dim OutlookApp As Outlook.Application
Dim OutlookTask As Outlook.TaskItem
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookTask = OutlookApp.CreateItem(olTaskItem)
With OutlookTask
 .Recipients = [EMAIL="email@email.com"]email@email.com[/EMAIL] 'This doesnt work either
 .Subject = "Time to charge serial" & Me.serial
 .Body = "charge needed"
 .StartDate = Me.nextcharge - 5
 .ReminderSet = True
 '.RemindTime = ("2:45 PM")
 '.DueDate = Me.Target_Date
 .ReminderPlaySound = True
 '.ReminderSoundFile = 'Modify path.
 .Save
End With
End Sub
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:08
Joined
Sep 21, 2011
Messages
14,038
Generally you concatentate the email addresses with a ;
I have not done anything with reminders, but I use

.To
.cc
.bcc
for my emails.?

If you have successfully sent to yourself, then it should just be a matter of a concatenated string in the place of the string of your email address.?

Just guessing though.
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 07:08
Joined
Apr 27, 2015
Messages
6,280
Just an observation, but if you are trying to assign a task, a reminder or even an e-mail, wouldn't you need to add .Send to your With statement? Also, try .Recipients.Add("somebody@domain.com") when adding recipients.
 
Last edited:

bruceblack

Registered User.
Local time
Today, 11:08
Joined
Jun 30, 2017
Messages
119
Nope dont need a .send when it comes to reminders.
Its working nicely right now, just need to add other people but myself.


.Recipients.Add(somebody@domain.com)

Application defiend or object defined error


didn't work. i tried many variations but to no avail.
No clue. The code is nice and short and straight forward and it works!
 

Mark_

Longboard on the internet
Local time
Today, 04:08
Joined
Sep 12, 2017
Messages
2,111
As I understand, reminder are user specific and are not "Send-able" the same way as an Appointment. They can be a property of an appointment though, so when sent they should add a local reminder for that user.
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:08
Joined
Sep 21, 2011
Messages
14,038
I would dispute that. You have to send reminders manually or is this for an Exchange server.?

Anyway,NauticalGent is correct, you need to add recipients and if you had walked through the code, you would have found that you need to use the assign method.?

https://msdn.microsoft.com/en-us/vba/outlook-vba/articles/taskitem-assign-method-outlook

The code below successfuly sent the task to a colleague of mine and we do not have an exchange server.

Should get you closer?

Code:
Private Sub Command9_Click()
Dim OutlookApp As Outlook.Application
Dim OutlookTask As Outlook.TaskItem
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookTask = OutlookApp.CreateItem(olTaskItem)
With OutlookTask
 .Assign
 .Recipients.Add ("laura@ent.co.uk")
 .Subject = "Time to charge serial" & Me.Text4
 .Body = "charge needed"
 .StartDate = Date + 5
 .ReminderSet = True
 '.RemindTime = ("2:45 PM")
 '.DueDate = Me.Target_Date
 .ReminderPlaySound = True
 '.ReminderSoundFile = 'Modify path.
 .Send
End With
Set OutlookApp = Nothing
Set OutlookTask = Nothing

End Sub
Nope dont need a .send when it comes to reminders.
Its working nicely right now, just need to add other people but myself.


.Recipients.Add(somebody@domain.com)

Application defiend or object defined error


didn't work. i tried many variations but to no avail.
No clue. The code is nice and short and straight forward and it works!
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 07:08
Joined
Apr 27, 2015
Messages
6,280
Could be a typo on the OP’s part, but the recipient’s email must be wrapped in quotes. As GasMan as stated, it works. I use this method just about everyday and it works swimmingly.

All that said, if your code is working than that is what is really important. Glad you got it sorted!
 
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 11:08
Joined
Sep 21, 2011
Messages
14,038
Could be a typo on the OP’s part, but the recipient’s email must be wrapped in quotes. As GasMan as stated, it works. I use this method just about everyday and it works swimmingly

Not a typo NG,
The email address in the first post was missing it's quotes as was the post supposedly copying your advice.

I've only been able to send the reminder, not insert it as well. The user then needs to copy it to their tasks manually.?
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 07:08
Joined
Apr 27, 2015
Messages
6,280
For the record, because of the security settings on our LAN and the forbidden use of Redeption, I am forced to use .Display and then send it from Outlook. Still a good utility though...
 
Last edited:

Mark_

Longboard on the internet
Local time
Today, 04:08
Joined
Sep 12, 2017
Messages
2,111
Gasman,

Isn't the reminder part of an appointment or task though? As I understand, once you've sent the appointment or task, you can't update another users task list to set reminders.
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:08
Joined
Sep 21, 2011
Messages
14,038
Gasman,

Isn't the reminder part of an appointment or task though? As I understand, once you've sent the appointment or task, you can't update another users task list to set reminders.


I would expect so Mark. I've never used them apart for myself and then only manually. I copied the code and amended as it was something I thought I might be able to use in the future.
 

bruceblack

Registered User.
Local time
Today, 11:08
Joined
Jun 30, 2017
Messages
119
Hey guys! Whats up

Still didnt get it to work. I dont get error messages or anything.
But my collegue does not get his reminder in his outlook callendar.

It DOES put a reminder in my own ofcourse...

Code:
Private Sub Command35_Click()
Me.lastcharge.Value = Date
DoCmd.RunCommand acCmdSaveRecord
searchfilterbox.SetFocus
MsgBox "Item has been marked as charged now. Next charge date reset to +90 days, Thanks!"
DoCmd.RunCommand acCmdSaveRecord
Dim OutlookApp As Outlook.Application
Dim OutlookTask As Outlook.TaskItem
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookTask = OutlookApp.CreateItem(olTaskItem)
With OutlookTask
 .Assign
 .Recipients.Add ([EMAIL="mycollegue@email.com"]mycollegue@email.com[/EMAIL])
 .Subject = "Time to charge serial number" & Me.serial
 .Body = "Weseman charge needed"
 .StartDate = Me.nextcharge - 5
 .ReminderSet = True
 '.RemindTime = ("2:45 PM")
 '.DueDate = Me.Target_Date
 .ReminderPlaySound = True
 '.ReminderSoundFile = "P:\WISSEL\Expeditie\21- Data Expeditie\Expeditool\assets\fey.wav" 'Modify path.
 .Save
End With
End Sub

What to do??
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:08
Joined
Sep 21, 2011
Messages
14,038
This works for me, albeit it goes in the users draft folder for one user but as a task and another as an email not task, unless I set a rule to move to another folder.
Either way it is sent.


See the difference? that error has been in your code since the start of this thread.?



Code:
Private Sub Command9_Click()
Dim OutlookApp As Outlook.Application
Dim OutlookTask As Outlook.TaskItem
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookTask = OutlookApp.CreateItem(olTaskItem)
With OutlookTask
 .Assign
 .Recipients.Add ("laura@xxx.co.uk")
 .Subject = "Time to charge serial" & Me.Text4
 .Body = "charge needed"
 .StartDate = Date + 5
 .ReminderSet = True
 '.RemindTime = ("3:00 PM")
 .DueDate = Date + 10
 .ReminderPlaySound = True
 '.ReminderSoundFile = 'Modify path.
 '.Display
 .Send
 MsgBox "Task Sent"
End With
Set OutlookApp = Nothing
Set OutlookTask = Nothing

End Sub
 

Mark_

Longboard on the internet
Local time
Today, 04:08
Joined
Sep 12, 2017
Messages
2,111
Bruce

are you trying to SAVE to your own tasklist or SEND to another's task list?

SAVE would imply your instance of outlook is doing the update to a table it uses.
SEND would imply you are asking another program (exchange server, other person's instance of outlook) to do the work.
 

bruceblack

Registered User.
Local time
Today, 11:08
Joined
Jun 30, 2017
Messages
119
Hi Mark!

Yes, im trying to send. Still it dont work. The other user doesnt get the reminder or task in their outlook.

We are on a exchange server indeed.
 

rede96

Registered User.
Local time
Today, 11:08
Joined
Apr 2, 2004
Messages
134
Hi Mark!

Yes, im trying to send. Still it dont work. The other user doesnt get the reminder or task in their outlook.

We are on a exchange server indeed.


I use some slightly different coding to send emails to multiple users and it works fine. I didn't write this, I just did a google search and found it. But see if it works for you.

You just need to make sure you've set your references in your VBA Module to include outlook 16 library.

Code:
Dim olApp As Object
Dim objMail As Object

On Error Resume Next ' If outlook is not open you get an error.

Set olApp = GetObject(, "Outlook.Application") 'See if Outlook is open

If Err Then 'Error found, Outlook is not open
    Set olApp = CreateObject("Outlook.Application") 'Create a new instance of Outlook
End If

'Create e-mail item
Set objMail = olApp.CreateItem(olMailItem)

With objMail

    'Set body format to HTML
    .BodyFormat = olFormatHTML
    'Add Recipients
    .To = "person1@email.com; person2@email.com; person3@email.com"
    'Add a subject
    .Subject = "Type your subject here."
    'Add a message
    .HTMLBody = "Type your message here."
    'If you want to send without viewing select .send.
    '.Send
    'If you want to display your email first select .display
    .Display

End With

Set olApp = Nothing
Set objMail = Nothing
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:08
Joined
Sep 21, 2011
Messages
14,038
Have you even changed the email address code?:confused:
 

rede96

Registered User.
Local time
Today, 11:08
Joined
Apr 2, 2004
Messages
134
Have you even changed the email address code?:confused:

Lol, not much no. :). I only had a quick look before.

I think the main change was

Code:
.Recipients

To

Code:
.To
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:08
Joined
Sep 21, 2011
Messages
14,038
Not directed at you rede96, but the o/p.



Lol, not much no. :). I only had a quick look before.

I think the main change was

Code:
.Recipients
To

Code:
.To
 

Users who are viewing this thread

Top Bottom