line1
line2
line3
line4
line5
line6
When selecting line2 and pressing Ctrl 2, you get double line spacing, i.e. a space
before the line.
When selecting line5 and going for PFM_SPACEBEFORE, you get the same effect, i.e. a space
before the line.
In rtf codes, this translates like this:
\par
line1\par
\pard\sl480\slmult1\ line2\par
\pard\sl240\slmult1\ line3\par
\par
\par
line4\par
\pard\sb160\sl240\slmult1\ line5\par
\pard\sl240\slmult1\ line6\par
\par
\par
Now the issue is here that
RichEdit50W (msftedit.dll) and
RichEdit60W (Office RichEd20.dll) behave differently:
The C:\Windows\System32\msftedit.dll version inserts the space
after the line,
while the MS Office versions inserts a space
before the line
In practice, this leads to
very ugly effects. If you had nicely formatted a document with 60W, with titles in double spacing, and you load that document into an editor with 50W, all your titles have the space afterwards but zero space before. In other words,
it's a mess.Fortunately, there is a relatively simple workaround for existing files:
include \masm32\MasmBasic\MasmBasic.inc
Init
Let esi=FileRead$(uCL$())
.While 1
.Break .if !Instr_(esi, "\slmult1\")
mov byte ptr [eax+7], "0"
.Endw
FileWrite "~tmp.rtf", esi
ShEx "~tmp.rtf"
EndOfCodeThis snippet (source & exe attached - just drag your rtf file over the exe) translates
slmult1 to
slmult0. This rtf code produces the same behaviour in both RichEdit versions (see also TaW's answer
here).
Greetings to Murray Sargent at Microsoft 