S
Satyen
Hi All
I am writing a Word Addin and I need to get the document content in byte
array - I tried doing SaveAs and re-opening it , but it gave me error that it
cannot access the file as it is being used by another process.
I can't close the file at this point
I am using C# in developing this Addin.
I searched and found some solution like below -
((Microsoft.Office.Interop.Word.Document)_document).ActiveWindow.Selection.WholeStory();
((Microsoft.Office.Interop.Word.Document)_document).ActiveWindow.Selection.Copy();
IDataObject data = Clipboard.GetDataObject();
But not sure if data.GetData(DataFormats.Rtf).ToString(); will lose some of
the Word objects (like tables / drawimgs etc)
Any help will be appreciated
I am writing a Word Addin and I need to get the document content in byte
array - I tried doing SaveAs and re-opening it , but it gave me error that it
cannot access the file as it is being used by another process.
I can't close the file at this point
I am using C# in developing this Addin.
I searched and found some solution like below -
((Microsoft.Office.Interop.Word.Document)_document).ActiveWindow.Selection.WholeStory();
((Microsoft.Office.Interop.Word.Document)_document).ActiveWindow.Selection.Copy();
IDataObject data = Clipboard.GetDataObject();
But not sure if data.GetData(DataFormats.Rtf).ToString(); will lose some of
the Word objects (like tables / drawimgs etc)
Any help will be appreciated