Open and Close outlook from Matlab

12 ビュー (過去 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
  1 件のコメント
Arnaud Bitoun
Arnaud Bitoun 2019 年 1 月 10 日
Thank you Kojiro,
Arnaud

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeActiveX についてさらに検索

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by