Insert a table in a selected portion of a word document
Hello, I am developing a simple add in for word where a user selects an area on the document and then click the button on the add in that says "generate table" and then a table is generated in the user selected section. Right now I know how to insert only text where the user selects.
var range = context.document.getSelection(); range.insertText("text", Word.InsertLocation.end);
That is how I do it with text, but with a table I cannot call document.getSelection and simply gange inserText to insertTable. I believe when I insert a table i have to call document.body which doesn't allow me to use the users selection in my code. Any ideas?
Submitted July 13, 2017 at 01:00AM by Iwrestlenow
via reddit http://ift.tt/2uRLpvb