Part of the generated Word document's SPELLING not default to English, but French

Last post 12-08-2011, 8:15 AM by praxairny. 2 replies.
Sort Posts: Previous Next
  •  12-07-2011, 3:54 PM 347619

    Part of the generated Word document's SPELLING not default to English, but French .NET

    Attachment: Present (inaccessible)

    When using the AsPose.Words to add the data to the document and click 'Spelling & Grammar', all of file check to English except one table default to French, here is the code to generate the table, I also appended the document and the spelling screenshot.

    Can you help me to check what' wrong with the code and hot to fix the default language to English?

    Thanks,
                builder.Writeln();
                builder.StartTable();

                // Row 1
                builder.InsertCell();
                builder.CellFormat.Shading.BackgroundPatternColor = Color.Gainsboro;
                builder.CellFormat.Borders.Left.LineWidth = 1.5;
                builder.CellFormat.Borders.Top.LineWidth = 1.5;
                builder.CellFormat.Borders.Right.LineWidth = 1;
                builder.CellFormat.Borders.Bottom.LineWidth = 1;
                builder.ParagraphFormat.SpaceBefore = 1;
                builder.ParagraphFormat.SpaceAfter = 1;
                builder.Write(" ");

                builder.InsertCell();
                builder.CellFormat.Borders.Left.LineWidth = 0;
                builder.CellFormat.Shading.BackgroundPatternColor = Color.Transparent;
                builder.Font.Name = "Arial";
                builder.Font.Size = 11;
                builder.Font.Bold = true;
                builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
                builder.Write("Inoculation:");

                builder.InsertCell();
                builder.CellFormat.Borders.Right.LineWidth = 1.5;
                builder.Write("Sampling:");

                builder.EndRow();

                // Row 2
                builder.InsertCell();
                builder.CellFormat.Borders.Left.LineWidth = 1.5;
                builder.CellFormat.Borders.Top.LineWidth = 0;
                builder.CellFormat.Borders.Right.LineWidth = 1;
                builder.CellFormat.Borders.Bottom.LineWidth = 1;
                builder.CellFormat.RightPadding = 5;
                builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;
                builder.Write("Start Date:");

                builder.InsertCell();
                builder.CellFormat.RightPadding = 0;
                builder.CellFormat.Borders.Left.LineWidth = 0;
                builder.Font.Bold = false;
                builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
                builder.Write(Job.StartInoculationDateAsText);

                builder.InsertCell();
                builder.CellFormat.Borders.Right.LineWidth = 1.5;
                builder.Write(Job.StartSamplingDateAsText);

                builder.EndRow();

                // Row 3
                builder.InsertCell();
                builder.CellFormat.Borders.Left.LineWidth = 1.5;
                builder.CellFormat.Borders.Top.LineWidth = 0;
                builder.CellFormat.Borders.Right.LineWidth = 1;
                builder.CellFormat.Borders.Bottom.LineWidth = 1;
                builder.CellFormat.RightPadding = 5;
                builder.Font.Bold = true;
                builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;
                builder.Write("Completion Date:");

                builder.InsertCell();
                builder.CellFormat.RightPadding = 0;
                builder.CellFormat.Borders.Left.LineWidth = 0;
                builder.Font.Bold = false;
                builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
                builder.Write(Job.EndInoculationDateAsText);

                builder.InsertCell();
                builder.CellFormat.Borders.Right.LineWidth = 1.5;
                builder.Write(Job.EndSamplingDateAsText);

                builder.EndRow();

                // Row 4
                builder.InsertCell();
                builder.CellFormat.Borders.Left.LineWidth = 1.5;
                builder.CellFormat.Borders.Top.LineWidth = 1.5;
                builder.CellFormat.Borders.Right.LineWidth = 1;
                builder.CellFormat.Borders.Bottom.LineWidth = 1.5;
                builder.Font.Bold = true;
                builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;
                builder.Write(" ");

                builder.InsertCell();
                builder.CellFormat.Borders.Left.LineWidth = 0;
                builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
                builder.Write("Job Completion Date:");

                builder.InsertCell();
                builder.CellFormat.Borders.Right.LineWidth = 1.5;
                builder.Write(Job.JobEndDateAsText);

                builder.EndRow();

                builder.EndTable();
                builder.Writeln();
                builder.StartTable();

                // Row 1
                builder.InsertCell();
                builder.CellFormat.Shading.BackgroundPatternColor = Color.Gainsboro;
                builder.CellFormat.Borders.Left.LineWidth = 1.5;
                builder.CellFormat.Borders.Top.LineWidth = 1.5;
                builder.CellFormat.Borders.Right.LineWidth = 1;
                builder.CellFormat.Borders.Bottom.LineWidth = 1;
                builder.ParagraphFormat.SpaceBefore = 1;
                builder.ParagraphFormat.SpaceAfter = 1;
                builder.Write(" ");

                builder.InsertCell();
                builder.CellFormat.Borders.Left.LineWidth = 0;
                builder.CellFormat.Shading.BackgroundPatternColor = Color.Transparent;
                builder.Font.Name = "Arial";
                builder.Font.Size = 11;
                builder.Font.Bold = true;
                builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
                builder.Write("Inoculation:");

                builder.InsertCell();
                builder.CellFormat.Borders.Right.LineWidth = 1.5;
                builder.Write("Sampling:");

                builder.EndRow();

                // Row 2
                builder.InsertCell();
                builder.CellFormat.Borders.Left.LineWidth = 1.5;
                builder.CellFormat.Borders.Top.LineWidth = 0;
                builder.CellFormat.Borders.Right.LineWidth = 1;
                builder.CellFormat.Borders.Bottom.LineWidth = 1;
                builder.CellFormat.RightPadding = 5;
                builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;
                builder.Write("Start Date:");

                builder.InsertCell();
                builder.CellFormat.RightPadding = 0;
                builder.CellFormat.Borders.Left.LineWidth = 0;
                builder.Font.Bold = false;
                builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
                builder.Write(Job.StartInoculationDateAsText);

                builder.InsertCell();
                builder.CellFormat.Borders.Right.LineWidth = 1.5;
                builder.Write(Job.StartSamplingDateAsText);

                builder.EndRow();

                // Row 3
                builder.InsertCell();
                builder.CellFormat.Borders.Left.LineWidth = 1.5;
                builder.CellFormat.Borders.Top.LineWidth = 0;
                builder.CellFormat.Borders.Right.LineWidth = 1;
                builder.CellFormat.Borders.Bottom.LineWidth = 1;
                builder.CellFormat.RightPadding = 5;
                builder.Font.Bold = true;
                builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;
                builder.Write("Completion Date:");

                builder.InsertCell();
                builder.CellFormat.RightPadding = 0;
                builder.CellFormat.Borders.Left.LineWidth = 0;
                builder.Font.Bold = false;
                builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
                builder.Write(Job.EndInoculationDateAsText);

                builder.InsertCell();
                builder.CellFormat.Borders.Right.LineWidth = 1.5;
                builder.Write(Job.EndSamplingDateAsText);

                builder.EndRow();

                // Row 4
                builder.InsertCell();
                builder.CellFormat.Borders.Left.LineWidth = 1.5;
                builder.CellFormat.Borders.Top.LineWidth = 1.5;
                builder.CellFormat.Borders.Right.LineWidth = 1;
                builder.CellFormat.Borders.Bottom.LineWidth = 1.5;
                builder.Font.Bold = true;
                builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;
                builder.Write(" ");

                builder.InsertCell();
                builder.CellFormat.Borders.Left.LineWidth = 0;
                builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
                builder.Write("Job Completion Date:");

                builder.InsertCell();
                builder.CellFormat.Borders.Right.LineWidth = 1.5;
                builder.Write(Job.JobEndDateAsText);

                builder.EndRow();

                builder.EndTable();

     
  •  12-08-2011, 4:43 AM 347795 in reply to 347619

    Re: Part of the generated Word document's SPELLING not default to English, but French

    Hi Anna,

    Thanks for your inquiry. I would suggest you read the following article and please try specifying Font.LocaleId before starting a new table:

    Example code would be as follows:

    DocumentBuilder builder = new DocumentBuilder();
    builder.Writeln();

    //builder.Font.LocaleId = 1036; // for French
    builder.Font.LocaleId = 1033; // for English - United States

    builder.StartTable();

    // Row 1
    builder.InsertCell();
    builder.CellFormat.Shading.BackgroundPatternColor = Color.Gainsboro;
    builder.CellFormat.Borders.Left.LineWidth = 1.5;
    builder.CellFormat.Borders.Top.LineWidth = 1.5;
    builder.CellFormat.Borders.Right.LineWidth = 1;
    builder.CellFormat.Borders.Bottom.LineWidth = 1;
    builder.ParagraphFormat.SpaceBefore = 1;
    builder.ParagraphFormat.SpaceAfter = 1;

    builder.Write(" ");
    ...
    ...

    I hope, this will help.

    Best Regards,

    Awais Hafeez
    Support Developer
    Aspose Sialkot Team
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
  •  12-08-2011, 8:15 AM 347856 in reply to 347795

    Re: Part of the generated Word document's SPELLING not default to English, but French

    Thanks! It works!
     
View as RSS news feed in XML