I have a word file in server and i want to display the file in aspx page with out showing contact details in that word file.Please help
i have already converted the word file to html and can view using iframe.But the problem is i dont want to display phone number and email.when iam cheched each string in that html file for specific format(either email or number) that string also includes html code and when it removes the html code also removed.i want to read the substring(only phone number or email) of each string in that html file and remove only that part
object missingType = Type.Missing;
object readOnly = true;
object isVisible = false;
object documentFormat = 8;
object htmlFilePath = Server.MapPath("~/Uploads/Resume/Temp/") + Resume + ".htm";
string directoryPath = Server.MapPath("Uploads/Resume/Temp/") + Resume + "_files";
object fileName = Server.MapPath("~/Uploads/Resume/" + Resume);
ApplicationClass applicationclass = new ApplicationClass();
applicationclass.Documents.Open(ref fileName,
ref readOnly,
ref missingType, ref missingType, ref missingType,
ref missingType, ref missingType, ref missingType,
ref missingType, ref missingType, ref isVisible,
ref missingType, ref missingType, ref missingType,
ref missingType, ref missingType);
applicationclass.Visible = false;
Document document = applicationclass.ActiveDocument;
document.SaveAs(ref htmlFilePath, ref documentFormat, ref missingType,
ref missingType, ref missingType, ref missingType,
ref missingType, ref missingType, ref missingType,
ref missingType, ref missingType, ref missingType,
ref missingType, ref missingType, ref missingType,
ref missingType);
document.Close(ref missingType, ref missingType, ref missingType);
byte[] bytes;
using (FileStream fs = new FileStream(htmlFilePath.ToString(), FileMode.Open, FileAccess.Read))
{
BinaryReader reader = new BinaryReader(fs);
bytes = reader.ReadBytes((int)fs.Length);
fs.Close();
}
string v="";
string v2 = "";
string value = System.Text.Encoding.UTF8.GetString(bytes);
string[] words = v.Split(' ');
foreach (string word in words)
{
if (word.Contains("9895843397"))
{
}
else
{
v2 += word;
}
}
litResume.Text = v2;