How do I add an Appointment in Outlook from within MATLAB 7.2 (R2006a)?
20 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2009-6-27
编辑: MathWorks Support Team
2024-8-1,9:23
I would like to know how I can add an appointment to Microsoft Outlook from within MATLAB using ActiveX. I would also like to attach the appointment to email created from within MATLAB.
采纳的回答
MathWorks Support Team
2024-8-1,0:00
编辑:MathWorks Support Team
2024-8-1,9:23
This example illustrates how to create and send an appointment in Outlook from within MATLAB using ActiveX:
h = actxserver('outlook.Application')
% Create the appointment object
appointment = h.CreateItem('olAppointmentItem')
% Set some common properties of the appointment object.
appointment.Subject = 'Myappointment'
appointment.Body = 'This appointment was created in MATLAB'
appointment.Location = 'myLocation'
appointment.Start = '04/26/2006'
appointment.End = '04/27/2006'
appointment.ReminderSet = 1
appointment.ReminderMinutesBeforeStart = 5
appointment.IsOnlineMeeting = 0
%Save the appointment
appointment.Save()
You can attach this appointment to an email and send it:
%Create email object
mail = h.CreateItem('olMailItem');
%Set properties of the email object
mail.Subject = 'This email was sent from within MATLAB';
mail.To = 'myemail@mathworks.com';
mail.Body = 'Please find your appointment attached';
mail.BodyFormat = 'olFormatHTML';
%Attach the appointment to the email
mail.attachments.Add(appointment);
%Send the email
mail.Send;
%Release the Outlook interface
h.release;
%
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Biological and Health Sciences 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!