Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Sep 21, 2017 2:29 am

I want using Tab in string
Example: Architecture Archaeology HillTribes Culture Nature Photography
I search forum but not work
par.Format.Tabs.AddTab(10).Justification =Spire.Doc.Documents.TabJustification.Left;
var txt = par.AppendText(join[0] + "\t" + join[1] + join[2] + "\t" + join[3] + "\t" + join[4] + "\t" + join[5] + "\t" + join[6] + "\t" + join[7]);
txt.CharacterFormat.TextBackgroundColor = Color.FromArgb(248, 250, 195);
please,Hope everybody help

huukhanh101990
 
Posts: 1
Joined: Mon Aug 14, 2017 10:03 am

Thu Sep 21, 2017 6:36 am

Dear huukhanh101990,

Thanks for your inquiry.
I have tested the scenario with the latest Spire.Doc Pack(hot fix) Version:6.0.8, and the result is correct. So please try to use this version.
Here is my testing code.
Code: Select all
            Document document = new Document();
            Section section = document.AddSection();
            Paragraph par = section.AddParagraph();
            //note the unit for the value 10 is the point.
            par.Format.Tabs.AddTab(10).Justification = Spire.Doc.Documents.TabJustification.Left;
            var txt = par.AppendText("Architecture" + "\t" + "Archaeology" + "\t" + "HillTribes" + "\t" + "Culture" + "\t" + "Nature" + "\t" + "Photography" );
            txt.CharacterFormat.TextBackgroundColor = Color.FromArgb(248, 250, 195);
            document.SaveToFile("11671.docx",FileFormat.Docx);

If there is still issue, please provide us the input and expected document( you could create it by MS word), then we will provide corresponding code for you.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Sep 27, 2017 8:35 am

Hello,

Have you tried the solution that provided by Betsy? Has the issue get resolved?

Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.Doc