Tuesday, 15 September 2015

c# Microsoft.Office.Interop.Word.Document to Stream -



c# Microsoft.Office.Interop.Word.Document to Stream -

i have active document :

microsoft.office.interop.word.document document = globals.thisaddin.application.activedocument;

how can convert stream?

or better, how send active document rest web service?

thanks

which rest-service? if it's sharepoint or i'm used calling saveas function follows:

microsoft.office.interop.word.document document = globals.thisaddin.application.activedocument; document.saveas("https://www.contoso.sharepoint.com/documents/document1.docx");

edit: p.s. can serialize stream. found reply here

public static memorystream serializetostream(object o) { memorystream stream = new memorystream(); iformatter formatter = new binaryformatter(); formatter.serialize(stream, o); homecoming stream; } public static object deserializefromstream(memorystream stream) { iformatter formatter = new binaryformatter(); stream.seek(0, seekorigin.begin); object o = formatter.deserialize(stream); homecoming o; }

c# ms-word add-in

No comments:

Post a Comment