私は、作業ウィンドウのボタンを使用して電子メールの本文を変更できるOutlook2016用のOffice365アドインで作業しています。タスクパネルのOutlookアドイン - スクロールしたテキストを置き換えた後の空白のボディ
HTML:JavaScriptで
<p><button onclick="createLongBody()">Set Long Body</button></p>
<p><button onclick="createShortBody()">Set Short Body</button></p>
<div id="status"></div>
:
function createLongBody() {
var longText = "<html><body>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/>Hello<br/></body></html>";
Office.context.mailbox.item.body.setAsync(longText, { coercionType: Office.CoercionType.Html }, function() {
$("#status").html("Long email complete!");
});
};
function createShortBody() {
Office.context.mailbox.item.body.setAsync("<html><body><h1>Hello</h1></body></html>", { coercionType: Office.CoercionType.Html }, function() {
$("#status").html("Short email complete!");
});
は複製するには:
- クリックして "ロングボディの作成" ボタン下、場所へ
- スクロール電子メールの末尾にカーソルを置く
- をクリックして「ショートボディを作成」ボタン
結果:「完全なショートメール」に
ステータステキストの変更が、新しいショートメールは表示されません - ボディは、単に空白になっています。
これはOfficeアドインAPIのバグですかどうか分かりませんが、コミュニティに提示して誰かがアイデアを持っているかどうかを確認したいのですか? 誰でも複製できますか?ありがとう!
は
ありがとう@FeiXue!状況をよりよく反映するために、より多くのコードで質問を編集しました。私は2番目の編集をプログラムで実行していません。ユーザは、ボディを再び変更するために別のボタンをクリックしなければならない。 – TB2016