0

https://github.com/OfficeDev/Word-Add-in-DocumentAssembly

I am trying to implement functionality like the above link targeting office 2013, yet the source does not run correctly because of the lack of a 'Word' object in JS. Can this code be ported or is there an example of similar code targeting 2013?

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
bischoffingston
  • 637
  • 9
  • 27

2 Answers2

3

The Word object is not available in Word 2013. You can implement much of the same functionality in Word 2013 by using OOXML and the different setSelectedDataAsync options. It won't be as convenient as what you have available in Word 2016. Here are some code samples that you can look through for examples. The older ones may have useful examples for your scenario.

Michael Mainer
  • 3,387
  • 1
  • 13
  • 32
  • Is there anyway to interact with the word document more precisely then just dumping text into it? The Word api has paragraphs, searching, etc – bischoffingston May 24 '16 at 13:31
  • The new API has some preview features in the WordApi 1.3 requirement set (2016 only). Go to https://dev.office.com/reference/add-ins/openspec and follow the link to the new Word features. For example, you can use paragraph.split to get the words in a paragraph. – Michael Mainer May 25 '16 at 17:39
1

To interact with word document more precisely, you need to find and replace by key/ paste your content at cursor location/ other than these not sure if any other way supported in 2013, again features available for 2013 is limited.

Follow the below sample, this has good info related to inserting different types of contents in the doc. http://dev.office.com/code-samples-detail/5791