Effacer les filtres
Effacer les filtres

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

4 vues (au cours des 30 derniers jours)
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.

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 27 Juin 2009
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('olMail');
%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;%

Plus de réponses (0)

Produits


Version

R2006a

Community Treasure Hunt

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

Start Hunting!

Translated by