September 11th, 2012, 03:46 AM
Word language issue
I am opening, editting, saving and then closing a word file using a dll. It writes a table which is then filled with string values provided by the user.
The issue is that the dll functions correctly if the user has installed word in German language. For a user who has installed Office in English language, I have to change the code and compile the dll again.
For e.g., the following is the part of code that draws table in a word document:
As clear from the code the table style is set to "Mittlere Formatvorlage 8". This style is "Table Grid 8" (example) in English.
object TableStyle = "Mittlere Formatvorlage 8";
Microsoft.Office.Interop.Word.Range tableLocation = m_ReportDoc.Range(ref start, ref end);
m_ReportDoc.Tables.Add(tableLocation, aRows, aColumn, ref MISSING, ref MISSING);
Now my questions are:
- how can I know in which language the word has been installed, so that depending on the installtion language, I can set the table style.
- Is there any method, so that I can set table style in German without accounting for the language. The word automatically looks for the replacement of given style in the installed language. This happens when I recieve a word file which was originally created in English but opens without any problem on my PC where the word is installed in German.
Thanks in advance.
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!