Hello everyone and sorry for my English: I have this macro that adds a style separator and it works fine, except it adds a blank space in front of the paragraph. How could I modify the macro so that it does not add it, or if it does add it, it removes it later?
Sub SeparadordeEstilos() With Selection .InsertBefore vbCr .InsertStyleSeparator .Paragraphs(1).Range.Font.Reset .Paragraphs(1).Style = ("PLL Nivel 2 notdc") End With End Sub
Thank you very much, too, Charles, and my apologies to everyone for not explaining all the details. I need, in an outline multilevel list, two types of paragraphs with the same numbering. Some with a bold font style and that appear in the table of contents and others with a normal font that do not appear in the TOC. So, I have created two styles, PLL Nivel 2 with bold that appears in the TOC and PLL Nivel 2 notdc, without bold, that does not appear in the TOC that is applied automatically with the style separator when executing the macro that I describe in the question . It is the only solution I have found to do it, especially because of the continuous numbering requirement.
Everything works fine except for the white space. This blank space is very bad in the document, it does not give it a professional touch, on the contrary, it gives it a sloppy appearance.
Therefore I need an alternative or to be able to remove the white space.
Here is a sample document with the problem. I thought that consecutive numbering worked fine because I saw it with Show all enabled, but if I turn it off, (Show all), it doesn't work either and sets a different numbering.