I want to get the particular value from Microsoft Word after read the specific word
For example if a word document which has text as follows:
Customer Details
Date: 23/6/2013
Name: Jason
Cust ID: A2441
So i want the program read if have word "Date" then it will get the value 23/6/2013 and place into textbox.
Then it will continue read word "Name" then will get Jason into textbox2.
How to get the value of date after i read date?
For example if a word document which has text as follows:
Customer Details
Date: 23/6/2013
Name: Jason
Cust ID: A2441
So i want the program read if have word "Date" then it will get the value 23/6/2013 and place into textbox.
Then it will continue read word "Name" then will get Jason into textbox2.
How to get the value of date after i read date?
VB.NET:
[COLOR=#00008B][FONT=Consolas]Dim[/FONT][/COLOR][FONT=Consolas] fd [/FONT][COLOR=#00008B][FONT=Consolas]As[/FONT][/COLOR][FONT=Consolas] OpenFileDialog [/FONT][FONT=Consolas]=[/FONT][FONT=Consolas] [/FONT][COLOR=#00008B][FONT=Consolas]New[/FONT][/COLOR][FONT=Consolas] OpenFileDialog[/FONT][FONT=Consolas]()[/FONT][/FONT][/COLOR]
fd.Title = [COLOR=#800000]"Open"[/COLOR]
fd.InitialDirectory = [COLOR=#800000]"C:\Documents"[/COLOR]
fd.Filter = [COLOR=#800000]"Word 97-2003 Documents (*.doc)|*.doc|Word Documents(*.docx)|*.docx"[/COLOR]
fd.RestoreDirectory = [COLOR=#800000]True[/COLOR]
[COLOR=#00008B]If[/COLOR] fd.ShowDialog() = DialogResult.OK [COLOR=#00008B]Then[/COLOR]
txtQuotaFileName.Text = fd.FileName
[COLOR=#00008B]End[/COLOR] [COLOR=#00008B]If[/COLOR]
[COLOR=#00008B]Dim[/COLOR] sReader [COLOR=#00008B]As[/COLOR] [COLOR=#00008B]New[/COLOR] StreamReader(fd.FileName)
[COLOR=#00008B]Dim[/COLOR] text [COLOR=#00008B]As[/COLOR] [COLOR=#00008B]String[/COLOR] = sReader.ReadToEnd()
sReader.Close()
[COLOR=#00008B]If[/COLOR] text.Contains([COLOR=#800000]"Date"[/COLOR]) [COLOR=#00008B]Then[/COLOR]
[COLOR=gray]'Get the value after Date : [/COLOR]
[COLOR=#000000][FONT=Arial][FONT=Consolas] [/FONT][COLOR=#00008B][FONT=Consolas]End[/FONT][/COLOR][FONT=Consolas] [/FONT][COLOR=#00008B][FONT=Consolas]If[/FONT][/COLOR]