Open and Close outlook from Matlab

조회 수: 7 (최근 30일)
Arnaud Bitoun
Arnaud Bitoun 2019년 1월 9일
댓글: Arnaud Bitoun 2019년 1월 10일
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

답변 (1개)

Kojiro Saito
Kojiro Saito 2019년 1월 10일
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

카테고리

Help CenterFile Exchange에서 Web Services에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by