Posted 8 September 2017, 4:34 am EST
SaveHTMLRange() allows me to specify a Stream instead of a File but I can not figure out how to use the Stream after it is populated.
I pass in a new MemoryStream (I tried both with and without specifying an initial capacity) and the function returns successfully.
The problem is that the Stream is already closed when it returns.
If I examine the Stream.GetBuffer() contents it appears to be populated, but there is no 'Open' method that would allow me to re-open and use it.
All I am trying to do here is to copy the selected cells to the clipboard in HTML format.
If I save it to a temp file and re-read the file it works fine, but I would prefer to use a memory object to avoid the file I/O.
(In VB6 I could simply have treated Stream.GetBuffer() as a string ... but that is not allowed in .Net.)
Any ideas here?