I am in the habit of writing MsgBox calls to display test results.
Here is a case where my habit fails me:
The MsgBox function filters out various non-printing characters and displays to me a beautiful message (see screen snapshot); all looks well.
The true story is revealed by the Debug.print statement, and of course in an apparently corrupt result.
<pre>Public Function strOfficeProductID()
strOfficeProductID = GetRegistryValue(HKEY_LOCAL_MACHINE, "SoftwareMicrosoftOffice9.0RegistrationProduct ID", "")
End Function
Sub TESTstrOfficeProductID()
Debug.Print strItem
MsgBox strItem
End Sub</pre>


Here is the debug print, with some of the offending characters removed:
<pre>50106-707-9999993-03601 9 9 9 9 3 - 0 3 6 0 1</pre>



If I've done it right, here's is a screen snapshot of the neater MsgBox result.