We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Bullets and numbering: Is it possible to restart numbering on Level 1?

With the latest version, is it possible to restart numbering on Level 1 when in outline mode?

Unfortunately it is not possible with the current version. We plan adding richer support for list numbering styles later this year.

Is this now possible? I have several documents that are being merged and I need the ability to restart the outline level 1 numbering for certain documents within the group.

Thanks.

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. Could you please attach your documents here for testing? I will investigate the issue and provide you more information.

Also, it would be useful, if you attach current output document and expected output.

Best regards.

I have uploaded 2 documents (Correct Merge.doc & Incorrect Merge.doc) You will notice the level 1 outline numbering is different between the documents.

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. In your case, if you use UseDestinationStyles option. Numbering will not be restarted, but if you use KeepSourceFormatting option – numbering will be restarted. So if you need to restart numbering in groups, you should use both option. Here is code that demonstrates how to combine your documents. Document has two groups, where numbering is restarted.

// Create empty document (main document)

Document mainDoc = new Document();

mainDoc.RemoveAllChildren();

// Create two empty documents (group documents)

Document group1Doc = new Document();

group1Doc.RemoveAllChildren();

Document group2Doc = new Document();

group2Doc.RemoveAllChildren();

// Get list of document parts

string[] fileNames = Directory.GetFiles(@"Test189\docs", "*.doc");

// Create first part of the main document

for (int i = 0; i < 3; i++ )

{

Document subDoc = new Document(fileNames[i]);

group1Doc.AppendDocument(subDoc, ImportFormatMode.UseDestinationStyles);

}

// Create second part of the main document

for (int i = 3; i < fileNames.Length; i++)

{

Document subDoc = new Document(fileNames[i]);

group2Doc.AppendDocument(subDoc, ImportFormatMode.UseDestinationStyles);

}

// Append groups to the main document

mainDoc.AppendDocument(group1Doc, ImportFormatMode.KeepSourceFormatting);

mainDoc.AppendDocument(group2Doc, ImportFormatMode.KeepSourceFormatting);

// Save output document

mainDoc.Save(@"Test189\out.doc");

Hope this could help you.

Best regards.

Thanks for the response and code snippet.

I forgot to mention that I need to force each appended document to use the styles in the master document. If I import with KeepSourceFormatting, I get additional styles added for each document. The master document will be comprised of around 80+ documents, that would make changing a heading style on the final document a nightmare.

I played around with

ListLevel level1 = style.ListFormat.ListLevel;
level1.StartAt = 1;

but that doesn't seem to work. Is there any type of work around to reset the numbering but not change and of the formatting? In MS Word you can right click the outline level and select restart.

Thanks.

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. When you use “Restart at 1” command in MS Word, it creates new list an move all following items to this list. I think the code example provided in the following thread could be useful for you:

Best regards.

The issues you have found earlier (filed as WORDSNET-4677) have been fixed in this Aspose.Words for .NET 20.7 update and this Aspose.Words for Java 20.7 update.