Open and Close outlook from Matlab

13 visualizaciones (últimos 30 días)
Arnaud Bitoun
Arnaud Bitoun el 9 de En. de 2019
Comentada: Arnaud Bitoun el 10 de En. de 2019
I am using code to write outlook email;
h = actxserver('outlook.Application');
mail = h.CreateItem('olMail');
mail.To = myemail@email.com;
mail.Subject = 'Subject';
mail.BodyFormat = 'olFormatHTML';
mail.HTMLBody = 'Test';
I am looking how to close and open Outllok. How can I do ?
Thanks in advance,
Arnaud

Respuestas (1)

Kojiro Saito
Kojiro Saito el 10 de En. de 2019
I think you need to add
mail.Send;
to send email.
In order to close and then open Outlook,
%% Close Outlook
Quit(h)
delete(h)
%% Open Outlook
h = actxserver('outlook.Application');
mapi = h.GetNamespace('mapi');
INBOX = mapi.GetDefaultFolder(6);
INBOX.Display

Productos


Versión

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by