Search and Replace

Home Forums Open-Xml-Sdk-JavaScript Search and Replace

This topic contains 1 reply, has 2 voices, and was last updated by  Eric White 8 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3415

    RalphZero
    Participant

    We are working with SharePoint and need to dynamically create complex word reports using data from our SharePoint Lists.
    We will start with template documents that we grab from a Document Library.
    From there, we will search the document for [[[Project Name]]] and replace this string with the actual project name. From there, we name the new doc and upload it to another document library.
    We did this before at the app server, using .NET, C# and OpenXML SDK 2.0.
    Now, we need to do this using JavaScript on the client.
    What would the javascript code be a standard document global search and replace?
    Thank You…

    #3475

    Eric White
    Keymaster

    Hi,

    Sorry for the long delay in reply. I’ve been heads-down on another very cool, but very difficult Open XML project, to be announced on this blog in the next day or son.

    There are two modules in the Open-Xml-PowerTools that can search and replace text:

    There is another module, DocumentAssembler, which also sounds as though it would meet your needs.

    Unfortunately, all of these modules are written in C#. The process to convert them to JavaScript is a complex, time consuming task. See this blog post for more information. Frankly, I do not know anyone other than myself who has the expertise necessary to do this conversion.

    I believe that there is only one approach that you can and should take, which is to write a web service in C# using Open-Xml-PowerTools, and then consume that web service from your JavaScript code.

    I have never written code that takes this approach, but I believe that it is possible.

    -Eric

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.