We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to convert Aspose.Word.Document to byte[]?

Hi,
How to convert Aspose.Word.Document to byte[] ?
I am converting excel to word. This aspose word document need to be converted to byte. Please help me.
Thank you.

Hi
Thanks for your inquiry. You can use the following code to achieve this:

// Create stream
MemoryStream docStream = new MemoryStream();
// Save document to stream
doc.Save(docStream, SaveFormat.Doc);
// Get byte array
byte[] docBytes = docStream.GetBuffer();

Hope this helps
Best regards.