How do I add an Appointment in Outlook from within MATLAB 7.2 (R2006a)?

20 次查看(过去 30 天)
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
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 个)

类别

Help CenterFile Exchange 中查找有关 Biological and Health Sciences 的更多信息

产品


版本

R2006a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by