How to use 'ControlChar'


i'd like to insert a 'tab' in front of some text that is dynamically rendered. I noticed that the 'tab' is a 'ControlChar', but i don't see how to use 'ControlChar' in any of the docs.

Is it in DocumentBuilder? I see one can insert a cell, a row, writeln, write, etc, but I don't see 'InsertControlChar'.

thanks in advance

[ps... life is *much* easier than it was before aspose.word ... thank you very much]


You can insert tab using Write("\t") or Write("\x0007").

It will use tab stops that are already defined for this paragraph in the document or default tab stops. There is no way to change tab stop positions using DocumentBuilder yet. Let me know if this is important to have.


actually, the only reason i have to insert tabs is because of the list formatting problem. Fixing that would make me happy.




I’m trying to insert tabs via the Write("\t") & Write("\x0007") method, but this is simply printing the text out in the word document. Am I missing something here. Thanks!



This is C# syntax. If you are using VB.NET it will probably print it out as is. You need to find how to specify escape characters in VB.NET in MSDN, I don’t remember from the top of my head.


try Write(Chr(7))


Write(Chr(7)) does not work in VB.NET, I got an error while generating the document.

But Write(ControlChars.Tab) does work. Thanks for your help!