How to use 'ControlChar'


#1

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]


#2

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.


#3

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

david


#4

Roman,

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!

Patrick


#5

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.


#6

try Write(Chr(7))


#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!