Hi,
I am trying to display a word document which has text in "Telugu" into windows forms application using either Rich Text Box control or any other out of box control using visual studio 2012. Can some one please help me how to achieve this. I am able to display text from word file which is in English language, but I want to display the text in "Telugu" language (one of the Indian popular language).
Appreciate your inputs and help
Here is my code:
private void btnRead_Click(object sender, EventArgs e)
{
CultureInfo ci;
Thread.CurrentThread.CurrentCulture = new CultureInfo("te-IN");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("te-IN");
ci = Thread.CurrentThread.CurrentCulture;
Microsoft.Office.Interop.Word.Application wrd = new Microsoft.Office.Interop.Word.Application();
object miss = System.Reflection.Missing.Value;
object path = @"C:\Sample\XYZ.docx";
object readOnly = true;
Microsoft.Office.Interop.Word.Document docs=wrd.Documents.Open(ref path, ref miss, ref readOnly, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss,ref miss, ref miss, ref miss, ref miss);
string totaltext = "";
for (int i = 0; i < docs.Paragraphs.Count; i++)
{
totaltext+=" \r\n "+ docs.Paragraphs[i+1].Range.Text.ToString();
}
rTxtDoc.Text = totaltext;
docs.Close();
wrd.Quit();
}
Thanks