Hi,
Thanks for the answer. However, it doesn't seem to work. I discovered the 1030-value by creating a word document with danish text and opening it with aspose.word. Then I created a document like this (which now includes your suggestion):
Aspose.Word.Document doc2 = new Aspose.Word.Document();
Aspose.Word.DocumentBuilder builder = new Aspose.Word.DocumentBuilder(doc2);
builder.PageSetup.PaperSize = Aspose.Word.PaperSize.A4;
builder.PageSetup.RightMargin = cmToPoints(2);
builder.PageSetup.LeftMargin = cmToPoints(2);
builder.PageSetup.TopMargin = cmToPoints(3);
builder.PageSetup.BottomMargin= cmToPoints(3);
builder.Font.LocaleId = 1030;
builder.Font.Bold = true;
builder.Write("dette skulle være dansk");
builder.Font.LocaleId = 1030;
NodeCollection paragraphs = doc2.GetChildNodes(NodeType.Paragraph, true);
foreach(Paragraph paragraph in paragraphs)
{
paragraph.Font.LocaleId = 1030;
}
doc2.Save(
System.IO.Path.Combine(System.Environment.CurrentDirectory, "generated.doc"),
Aspose.Word.SaveFormat.FormatDocument);
- but the output is still reported as "English (U.S.)". Re-opening it with aspose reveals that the locationId is 1030, but Word doesn't recognize it.
I've attached a zip with my test-app so you can try it out. in .\bin\debug\ you'll find "danish.doc" that is all danish and the application has three buttons:
1) read and report all locationId's within "danish.doc"
2) create a document with only danish (1030) text, as illustrated in the code above.
3) read and report all locationId's within "generated.doc"
Button 1 reports "1030" to me.
Button 2 creates file that - when opened in word - contains only english (US) text
Button 3 reports that the "generated.doc" file is written with locationId 1030.
I don't get it. I set the value - I can read the value again - but word doesn't recognize it.
I'm using Microsoft Office 2002 (XP).
BTW: will iterating over paragraph nodes of a document also set the locationId of text within table cells ?