将制表符空间添加到邮件正文

时间:2019-09-09 13:31:46

标签: vba outlook

我要在文本正文中添加制表符/空格,特别是在“ 1”之前和之后。

我尝试了“”和Space(10)。

 sBodyStart = "<font size=""3"" face=""Calibri"" color=""black"">" & _
                "Good Afternoon," & "<br>" & "<br>" & vbCrLf & vbCrLf & _
                "Please confirm and acknowledge the below by responding with the appropriate voting button." & "<br>" & "<br>" & _
"1. Do not share this information." & "<br>" & "<br>" & _
                "Please provide a response to this email using the voting buttons, no later than September 20, 2019. If you have any questions, please do not hesitate to reach out." & "<br>" & "<br>" & "<br>" & vbCrLf & vbCrLf & _
                "</font>"

3 个答案:

答案 0 :(得分:1)

这实际上是嵌入VBA中的HTML,它将忽略空格。如果添加"&nbsp;"

应该可以

答案 1 :(得分:0)

使用const fsp = require('fs').promises; const path = './lvl'; async function readFiles() { // Read the file list const files = await fsp.readdir(path); // `map` over the file list and return a promise to read each one const promises = files.map(file => fsp.readFile(`${path}/${file}`, 'utf8')); // `Promise.all` waits for the promises to be resolved return Promise.all(promises); }; (async () => { // Get your data const data = await readFiles(); // `map` over the data again and assign ranks // depending on the value in the file const ranks = data.map(lvl => { if (lvl > 100) return { rank: 1, lvl }; if (lvl > 50) return { rank: 2, lvl }; if (lvl > 20) return { rank: 3, lvl }; return { rank: 0, lvl }; }); // Assuming the files have content like 67, 50, 102, // you'll end up with an array of objects that looks // something like this: // [ // { rank: 2, lvl: '67' }, // { rank: 3, lvl: '50' }, // { rank: 1, lvl: '102' } // ] console.log(ranks); })(); vbTab

如果使用Chr(9),它将放置10个空格。 Outlook有一个讨厌的习惯,即“纠正”多余的空间,或者完全消除它们,或者将它们转换为不间断空间(Space(10)

答案 2 :(得分:0)

如何处理某些html实体,例如:

 &nbsp; to add a single space.
 &ensp; to add 2 spaces.
 &emsp; to add 4 spaces.
 or some  other "special" char from unicode ?

通过尝试

可以使前景生活变得更加有趣
  <span>&nbsp;</span>