在将html数据设置为Office上下文邮箱项目正文时,我遇到任何问题。 https://docs.microsoft.com/en-us/javascript/api/outlook_1_5/office.Body?product=outlook&version=v1.5&view=office-js我点击了此链接,但在本地使用https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js文件。我将尝试使用
Office.context.mailbox.item.body.getAsync(Office.CoercionType.Html,function(result){ var newHtml = result.value.replace(“”,“ veeeeeeretertertertret。”)
//-- sqlite3 db --//
////////////////////
var sqlite3 = require('sqlite3').verbose()
function AddChatlogToDB(from,to,content){
// open the database
let db = new sqlite3.Database('./chatLog.db', sqlite3.OPEN_READWRITE, (err) => {
if (err) {
console.error(err.message);
return false;
}
/////INSERT INTO TABLE
db.run("INSERT INTO chatLogs (cl_time,cl_from,cl_to,cl_content) VALUES (?,?,?,?)",
[Date.now(),from,to,content]);
db.close((err) => {
if (err) {
console.error(err.message);
}
//console.log('Close the database connection.');
return true;
});
console.log("chatlog: ", from,to,content);
});
}
function getLast20ChatLogs(uid, callback){
let db = new sqlite3.Database('./chatLog.db', sqlite3.OPEN_READWRITE, (err) => {
if (err) {
console.error(err.message);
return;
}
let sql = 'Select * from chatLogs WHERE cl_to IS NULL ORDER BY cl_time DESC limit 20;'
db.all(sql, [], (err, rows) => {
if (err) {
throw err;
}
if(callback) callback(rows);
});
db.close((err) => {
if (err) {
console.error(err.message);
}
});
});
}