Fix a bug in the Application.PlainText() method
I found a bug in the Application.PlainText() method. This method "Strips the rich text formatting from a string and returns an unformatted text string."
I don't know where else to report a bug like this. I reported the CTRL+A SQL editor bug to UserVoice and it was fixed.
I am writing a SQL formatter that will adjust the layout and colorize a SQL statement in a Rich Text box. I expect PlainText() to remove Rich Text formatting without corrupting the SQL statement.
You can reproduce this bug in the Immediate Window.
? PlainText("SELECT Record_ID,<BR>'Hello ' & Name")
correctly returns:
SELECT Record_ID,
'Hello ' & Name
but if the<BR> is before a comma, it removes the space before the "&"
? PlainText("SELECT Record_ID<BR>, 'Hello ' & Name")
returns:
SELECT Record_ID
, 'Hello '& Name
Notice that the space before the "&" is now missing.
A work-around I am testing:
replace( {text} ,"<BR>,","<BR>, ") ' (two spaces are after the comma)
