Copy the contents of Excel to Word using App(Javascript)

Category: developing apps for office 2013

Question

superBIIT on Wed, 30 Dec 2015 06:55:54


I want to copy my whole excel sheet to word and whenever I do changes in Excel file, it should get reflected in Word also. Through Add-Ins it is quite easy. As I am new to Apps, help me out . !

Replies

Starian chen on Thu, 31 Dec 2015 03:44:22


Hi superBIIT,

There aren’t the copy and paste function in word or excel add-ins. Also, we can’t capture the changes in word or excel add-ins.

You may try these steps:

  1. Get the data in excel in Excel add-ins
  2. Store the data in web browser storage (localStorage)
  3. Get the data in web browser storage in Word add-ins
  4. Set the data to document in word add-ins.

There is an article that may benefit you:

# Apps for Office: Enable communication between apps

https://code.msdn.microsoft.com/officeapps/Apps-for-Office-Enable-46024745

Regards

Starain

superBIIT on Thu, 07 Jan 2016 11:11:14


So there is no function or method like below in Office Apps ?

wordDoc.ActiveWindow.Selection.PasteExcelTable(true, false, false);


Starian chen on Fri, 08 Jan 2016 02:04:04


Hi superBIIT,

Yes, you need to do it in your code to simulate the copy and paste logical (get data, set data).

Regards

Starain