© copyright 19.Oct.2009 by Paul Bradley filed under Visual Basic
I am currently developing a document management system, using Word as the editor which is embedded into a picture box on a form, so that I have complete control over it's operation / integration. The system uses RTF as the document format, which gets stored into a database. I have no problem setting the Language for the file initially, as I send the RTF code
deflang2057 to set the default language to English UK.
However, when the saved RTF is retrieved from the database, Word would always switch the Language to English US, so I have to force the Language back to English UK by changing the language ID for the active document using the following syntax :-
Public WithEvents ObjWord As Word.Application ObjWord = New Word.ApplicationClass ObjWord.Visible = True ObjWord.Documents.Open("c:\body.rtf") ObjWord.ActiveDocument.Range.LanguageID = Word.WdLanguageID.wdEnglishUK
About the Author
Paul Bradley is a VB.NET software developer living and working in Cumbria. He has over 20 years programming experience. He also produces e-learning videos at Linux by Example