Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7680567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:08:40+00:00 2026-05-31T18:08:40+00:00

I am looking for alternatives to using openxml for a server-side word automation project.

  • 0

I am looking for alternatives to using openxml for a server-side word automation project. Does anyone know any other ways that have features to let me manipulate word bookmarks and tables?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T18:08:41+00:00Added an answer on May 31, 2026 at 6:08 pm

    I am currently doing a project of developing a word automation project for my company and I am using DocX Very simple and straight forward API to work with. The approach I am using is, whenever I need to work with XML directly, this API has a property named “xml” in the Paragraph class which gives you access to the underlying xml direclty so that I can work with it. The best part is its not breaking the xml and not corrupting the resulting document. Hope this helps!

    Example code using DocX..

     XNamespace ns = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
        using(DocX doc = DocX.Load(@"c:\temp\yourdoc.docx"))
        {
             foreach( Paragraph para in doc.Paragraphs )
             {
                 if(para.Xml.ToString().Contains("w:Bookmark"))
                 {
                     if(para.Xml.Element(ns + "BookmarkStart").Attribute("Name").Value == "yourbookmarkname")
                      {
                              // you got to your bookmark, if you want to change the text..then 
                              para.Xml.Elements(ns + "t").FirstOrDefault().SetValue("Text to replace..");
                      }
                 }
             }
        }
    

    Alternative API exclusively to work with bookmarks is .. http://simpleooxml.codeplex.com/

    Example on how to delete text from bookmarkstart to bookmarkend using this API..

     MemoryStream stream = DocumentReader.Copy(string.Format("{0}\\template.docx", TestContext.TestDeploymentDir));
     WordprocessingDocument doc = WordprocessingDocument.Open(stream, true);
     MainDocumentPart mainPart = doc.MainDocumentPart;
    
     DocumentWriter writer = new DocumentWriter(mainPart);
    
     //Simply Clears all text between bookmarkstart and end
     writer.PasteText("", "YourBookMarkName");
    
    
     //Save to the memory stream, and then to a file
     writer.Save();
    
     DocumentWriter.StreamToFile(string.Format("{0}\\templatetest.docx", GetOutputFolder()), stream);
    

    Loading the word document into different API’s from memory stream.

    //Loading a document file into memorystream using SimpleOOXML API
    MemoryStream stream = DocumentReader.Copy(@"c\template.docx");
    
    //Opening it from the memory stream as OpenXML document
    WordprocessingDocument doc = WordprocessingDocument.Open(stream, true);
    
    //Opening it as DocX document for working with DocX Api
    DocX document = DocX.Load(stream); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any alternatives to the Open Source Job Scheduler ? I'm looking for
I am looking at using design by contract for a personal project in C#
I'm looking for alternatives to GraphViz. I've been using GraphViz for more than a
I'm looking to build a dynamic website without bringing much extra server-side code/apps into
I'm looking for alternatives to Supersized. I'm currently using version 3.0 to show some
I'm looking for new alternatives in creating/changing doc/docx files from word template (asp.net). In
Anyone have any experience using SWIG ? I am currently researching QuantLib and saw
I am looking for an alternative to using an object/variable in global scope --
I'm looking to find alternatives to Solr from the Apache Software Foundation. For those
I am looking for more advanced alternatives to xsd.exe . I am just about

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.