Search code examples
c#listopenxmlspacenumbered

how to remove white space content between the bullet symbol and the paragraph using OpenXML


I'm creating a word document using c# and OpenXML. In the document I have several bulleted lists, My question is how to change the size of or remove the white space content between the bullet symbol and the paragraph?


Solution

  • Ok, I found it, I had to add LevelSuffix element into my Level element, Like this :

    var a = new AbstractNum(
                                    new Nsid() { Val = "FFFFFF80" }
                                    , new MultiLevelType() { Val = MultiLevelValues.HybridMultilevel }
                                    , new Level(
                                      new LevelSuffix { Val = LevelSuffixValues.Space, },
                                      new NumberingFormat() { Val = NumberFormatValues.Bullet },
                                      new LevelText() { Val = "-" }
                                    ) { LevelIndex = 0 }
                                  ) { AbstractNumberId = abstarctnumberId };
    

    I also found this page very useful.