I send SQL to interested parties via Outlook as HTML, with Word as the editor.
I like to format my SQL using spaces, rather than tabs.
When I paste the SQL into the editor, formatting is spot on. But the 'sent' version removes leading spaces.
For example:
Select
*
From
Employees
becomes
Select
*
From
Employees
Is there an option to prevent this?
I didn't find solution but found workaround - to replace all (and only) leading spaces to Nonbreaking Spaces. No needs to replace all ever spaces, only leading ones. This way Outlook will not trim them automatically while sending email.
Before send an email need to
"^p "
(caret, p, space) or click at the bottom [Special] button and choose Paragraph Mark and just a space character"^p^s"
(caret, p, caret, s) or click at the bottom [Special] button and choose Paragraph Mark and Nonbreaking SpaceResult with leading spaces:
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
With leading nonbreaking spaces:
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