Free Support Forum - aspose.com

First bullet is missing

Hi,

I’m trying to get the lists working in an existing paragraph using a bookmark, but it keeps on giving a result like:

point1
*point2
*point3

instead of
*point1
*point2
*point3

Here’s a snippet of the code that I use to trial this:

Documentbuilder builder = new documentbuilder(doc);

builder.movetobookmark(name);
builder.listformat.list = doc.lists.add(Listtemplate.bulletdefault);
builder.Writeln(“blah blah”);
builder.Writeln(“blah blah”);
builder.Writeln(“blah blah”);


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

Thanks for your request. I think that you can try using the following code.

//Open document

Document doc = new Document(@"Test136\in.doc");

DocumentBuilder builder = new DocumentBuilder(doc);

//Move cursor to bookmark

builder.MoveToBookmark("myBookmark");

//Start bolleted list

builder.ListFormat.ApplyBulletDefault();

//Insert items

builder.Writeln("blah blah");

builder.Writeln("blah blah");

builder.Writeln("blah blah");

//End list

builder.ListFormat.RemoveNumbers();

//Save output document

doc.Save(@"Test136\out.doc");

I hope this could help you.

Best regards.

Many thanks! works as required.