Attached is DLL you may try to use.
Code is basically the, just fixed a big and removed some flags
Declare
Declare Ansi Function GetRichText Lib "ExStreamOut.dll" _
(ByVal hwndRichEdit As Integer, ByVal sRtf As StringBuilder, ByVal iRtfMax As Integer) As Integer
If there is insufficient space the function return the number of bytes needed (negative number)
If the function fails for some other reason it return -Int32.MaxValue.
example call to the function
Dim Rtf As New StringBuilder ' (1)
Dim res As Integer
While True
res = GetRichText(richHandle, Rtf, Rtf.Capacity)
If res > 0 Or res = -Int32.MaxValue Then
Exit While
End If
Rtf.Capacity += -res
End While