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

Free Support Forum - aspose.com

TabStops.Clear() doesn't work

Some sample but incomplete code:

DocumentBuilder builder = new DocumentBuilder(_document);
builder.PageSetup.LeftMargin = ConvertUtil.InchToPoint(1.0 d);
builder.PageSetup.TopMargin = ConvertUtil.InchToPoint(1.8 d);
builder.PageSetup.BottomMargin = ConvertUtil.InchToPoint(0.9 d);
builder.PageSetup.RightMargin = ConvertUtil.InchToPoint(1.0 d);

I cannot get rid of ANY of the tabstops when calling the clear… I see the default tab stops still in the file. I notice that someone else had this issue with the Styles objects. I suspect it’s related. How soon can something such as this be fixed? I tried Aspose.Words versions and for C# .NET. No luck.


Thanks for your inquiry. Could you please also attach your input document and expected output? I will investigate the issue and provide you more information.
Best regards,

Input is a new and empty microsoft word 2003 document. The output should have all tabstops in the header removed. There are 2 (center and right), just like with the input document.


Thanks for your request. As I can see tab stops are defined in “Header” style, so if you need to remove these tab stops, you should remove them from this style. Please see the following code:

Document doc = new Document(@"Test001\in.doc");
Style headerStyle = doc.Styles["Header"];

Hope this helps.
Best regards.

That works! I will say this, however… that was NOT the obvious workflow. Where are the default named styles documented?


Thanks for your inquiry. I think you are looking for StyleIdentifier enum: https://reference.aspose.com/words/net/aspose.words/styleidentifier/
Hope this helps.
Best regards.