Hi Venkatesh Desai,
I hope this code will helpful for you.
Microsoft.Office.Interop.Word.ApplicationClass Application = new Microsoft.Office.Interop.Word.ApplicationClass();
object nullobj = System.Reflection.Missing.Value;
object file = Server.MapPath("CV.docx");
object value = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word.Document doc = Application.Documents.Open(ref file,ref nullobj, ref nullobj, ref nullobj,ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj,ref value,ref value,ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj);
doc.Activate();
var x = doc.Words;
cn.Open();
SqlCommand cmd = new SqlCommand("SELECT DISTINCT SkillId FROM tblSkills ORDER BY SkillId", cn);
cmd.CommandType = CommandType.Text;
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
string SkillName = "";
string SetSkills = "";
string FetchSkill = "";
if (ds.Tables[0].Rows.Count > 0)
{
string Doc_Content = doc.Content.Text;
for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
{
SkillName = ds.Tables[0].Rows[i]["SkillId"].ToString();
if (Doc_Content.ToString().IndexOf(SkillName) > 0)
{
SetSkills += SkillName + ",";
}
}
}
cn.Close();
txtResult.Text = SetSkills.TrimEnd(',').ToString();
doc.Close(ref nullobj, ref nullobj, ref nullobj);