I am trying to convert the memory stream generated from richeditDocument to byte array. The code is given below: Public …