Is it possible to use other packages such as Microsoft.Office.Interop.Word
?
The following code worked well for me in Office 2016, you can try if it works for Office 365.
public static void InteropExcel()
{
var application = new Microsoft.Office.Interop.Word.Application();
var sourceDoc = application.Documents.Open(@"D:\test\word\13.docx");
sourceDoc.ActiveWindow.Selection.WholeStory();
sourceDoc.ActiveWindow.Selection.Copy();
var destDocument = application.Documents.Open(@"D:\test\word\1.docx");
destDocument.ActiveWindow.Selection.Paste();
sourceDoc.Close();
destDocument.Close();
application.Quit();
}
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.