Code Monkey home page Code Monkey logo

Comments (4)

PrzemyslawKlys avatar PrzemyslawKlys commented on September 25, 2024 1

I guess the easiest would be add more styles to OfficeIMO.

  1. Create list in word
  2. Open this word in Open XML SDK 2.5 Productivity Tool

image

  1. Copy AbstractNum as a style to WordListStyle following the pattern that is there
  2. Modify Enum to add new style (s)

Of course one could expand the customliststyle as well, but I haven't yet had the time to implement allowing you to assign AbstractNum to existing doc.

It actually probably is not even that hard you would just need to improve on AddList and instead of picking up style you could provide your own AbstractNum from the code:

internal void AddList(WordListStyle style, bool continueNumbering) {
CreateNumberingDefinition(_document);
var numbering = _document._wordprocessingDocument.MainDocumentPart!.NumberingDefinitionsPart!.Numbering;
_abstractId = GetNextAbstractNum(numbering);
_numberId = GetNextNumberingInstance(numbering);
var abstractNum = WordListStyles.GetStyle(style);

Of course it would be nicer to have our own class that is a bit easier to use than what OpenXml requires.

from officeimo.

tmpmachine avatar tmpmachine commented on September 25, 2024

Never built a package before, so I was feeling out of options. Got it working now, I'm adding new styles. thanks!

from officeimo.

PrzemyslawKlys avatar PrzemyslawKlys commented on September 25, 2024

I think this needs to stay until it's completed :)

from officeimo.

PrzemyslawKlys avatar PrzemyslawKlys commented on September 25, 2024

I've added those additional lists. So closing this one.

from officeimo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.