none
Provide Find and replace text using apps RRS feed

  • Question

  • Hi 

    I have a document which has texts like below: 

    Comment Start: Please ensure that you fill up this content Comment:End

    This kind of text exists in different pages of the document. 

    I would like to develop an app which will remove these text. 

    We had similar functionality provided via VB macro code add-in. 

    I am very new to apps for office and also checked samples but they are not so helpful in my scenario. 

    Can anyone please assist? 

    Regards,

    RK


    Radhakrishna

    Thursday, July 30, 2015 5:03 PM

Answers

  • Hi Radhakrishna,

    >>This kind of text exists in different pages of the document. <<

    It seems that you were developing Office add-ins for Word. As far as I know, there is no such API we can replace the text directly in Word add-ins.

    As a workaround, we can select the range we want to process and get the data in the selection via Office.context.document.getSelectedDataAsync. Then we can manipulate the string and save it via Document.setSelectedDataAsync. In addition, to keep the format of rignal text, we can return the data in selection by HTML or Ooxml format.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, July 31, 2015 3:34 AM
    Moderator