Html Microsoft Word/Outlook修剪前导空间

Html Microsoft Word/Outlook修剪前导空间,html,ms-word,outlook,editor,trim,Html,Ms Word,Outlook,Editor,Trim,我通过Outlook将SQL作为HTML发送给感兴趣的各方,并使用Word作为编辑器 我喜欢使用空格而不是制表符格式化SQL 当我将SQL粘贴到编辑器中时,格式设置非常准确。 但“已发送”版本会删除前导空格 例如: Select * From Employees 变成 Select * From Employees 是否有防止此情况发生的选项?简介:以纯文本形式发送电子邮件以保留空白 在Outlook 2013中,faaaar花了太多时间尝试(但失败)覆盖HTML段落样式、覆盖列表样式/

我通过Outlook将SQL作为HTML发送给感兴趣的各方,并使用Word作为编辑器

我喜欢使用空格而不是制表符格式化SQL

当我将SQL粘贴到编辑器中时,格式设置非常准确。 但“已发送”版本会删除前导空格

例如:

Select
 *
From
 Employees
变成

Select
*
From
Employees
是否有防止此情况发生的选项?

简介:以纯文本形式发送电子邮件以保留空白

在Outlook 2013中,faaaar花了太多时间尝试(但失败)覆盖HTML段落样式、覆盖列表样式/字符以及调整自动格式化设置后,回退解决方案可能是发送任何电子邮件,对于这些电子邮件,必须将空白保留为纯文本

可以通过以下方式以纯文本形式发送电子邮件:

  • 选择“文本格式”功能区选项卡
  • 在“格式”组中选择纯文本

  • 我没有找到解决方案,但找到了解决办法——将所有(且仅)前导空格替换为非中断空格。不需要替换所有的空格,只需要前面的空格。这样,Outlook在发送电子邮件时不会自动修剪它们

    在发送电子邮件之前,需要

  • 选择要保留前导空格的文本,然后运行“查找并替换”(Ctrl+H)
  • 放入查找内容:
    “^p”
    (插入符号、p、空格)或单击底部的[特殊]按钮,然后选择段落标记和空格字符
  • 放入替换为:
    “^p^s”
    (插入符号,p,插入符号,s)或单击底部的[特殊]按钮,然后选择段落标记和不间断空格
  • 现在按[全部替换]-它将仅在所选文本中将前导空格替换为不间断空格,其余文本保持不变

  • 带前导空格的结果:

    First without leading spaces
    One leading space in this row
    No leading spaces again
    One leading space in this row
      Two leading spaces here
    One leading space in this row
    No leading spaces again
    One leading space in this row
      Two leading spaces here
      Two leading spaces here
    One leading space in this row
      Two leading spaces here
      Two leading spaces here
       Three leading spaces here
    
    First without leading spaces
     One leading space in this row
    No leading spaces again
     One leading space in this row
      Two leading spaces here
     One leading space in this row
    No leading spaces again
     One leading space in this row
      Two leading spaces here
      Two leading spaces here
     One leading space in this row
      Two leading spaces here
      Two leading spaces here
       Three leading spaces here
    
    使用前导非中断空格:

    First without leading spaces
    One leading space in this row
    No leading spaces again
    One leading space in this row
      Two leading spaces here
    One leading space in this row
    No leading spaces again
    One leading space in this row
      Two leading spaces here
      Two leading spaces here
    One leading space in this row
      Two leading spaces here
      Two leading spaces here
       Three leading spaces here
    
    First without leading spaces
     One leading space in this row
    No leading spaces again
     One leading space in this row
      Two leading spaces here
     One leading space in this row
    No leading spaces again
     One leading space in this row
      Two leading spaces here
      Two leading spaces here
     One leading space in this row
      Two leading spaces here
      Two leading spaces here
       Three leading spaces here
    

    任何人都知道如何解决这个问题??哈哈-天哪,这是可行的,但是哦,我的天啊,实施起来多么混乱啊。假设现在是为Word编写宏的最佳时机!再次感谢:)哥们!怎么就没有其他人觉得这个解决方案有用呢!!!我发现自己几乎每天都在使用它,但我仍然不知道如何使它成为一个宏!!!我们忘了投票。我差点就自杀了!我真丢脸,谢谢你的提醒。不幸的是,我讨厌这个解决方案,但这不是科斯塔斯的错。谢谢你的回复。是的,我知道你对这件事变成的浪费时间的行为的感觉。