none
Office Word Add-in - Writing Text to Document RRS feed

  • Question

  • Hello,

    I'm currently working on creating an Office Add-in specifically for Word, that will need to be able to change some of the text in the document currently open.

    I have found documentation for reading the document text, as well as reading and writing text that the user selects. The following are links to some of the documentation I have found - Read/Write Selection (https://msdn.microsoft.com/EN-US/library/office/fp123513.aspx) and Read Document (https://msdn.microsoft.com/EN-US/library/office/jj715279.aspx)

    However, I haven't been able to find any functionality to edit the text of the document without requiring the user to select the text beforehand. Therefore, my two questions are:

    - Is it possible to edit the text in the document without requiring the user to select the text beforehand?

    - If so, is there some documentation I might have missed that will show how to implement that functionality?

    Thank you in advance!

    Wednesday, September 9, 2015 6:46 AM

Answers

  • Hi Rothaq

    <<- Is it possible to edit the text in the document without requiring the user to select the text beforehand?>>

    No, unless this is a prepared document where the parts you add-in should access have already been "bound". But if it's "any" document, then, no, the Office 2013 APIs can't do this.

    If you need that kind of functionality, wait for the Office 2016 APIs (which can only be used with 2016 and later versions).


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, September 9, 2015 6:44 PM

All replies

  • Hi Rothaq

    <<- Is it possible to edit the text in the document without requiring the user to select the text beforehand?>>

    No, unless this is a prepared document where the parts you add-in should access have already been "bound". But if it's "any" document, then, no, the Office 2013 APIs can't do this.

    If you need that kind of functionality, wait for the Office 2016 APIs (which can only be used with 2016 and later versions).


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, September 9, 2015 6:44 PM
  • Okay, thanks for the quick response!
    Thursday, September 10, 2015 7:12 AM