S
Sandeep Sharma
Hi,
I have a custom property name "test" whose value
is "great" in one of my word document which is in word
2000.
I am opening the word document thru a c# application and
then added that field into the document using following
code.
Word.Selection sln = aDoc.ActiveWindow.Selection;
(aDoc.Paragraphs.Count).Range;
object fieldType = Word.WdFieldType.wdFieldEmpty;
object text = "DOCPROPERTY \"test\" ";
object objTrue = true;
Word.Field fld;
fld = sln.Fields.Add(sln.Range, ref fieldType, ref text,
ref objTrue);
MessageBox.Show("Field data " + fld.Data); //runtime error.
I want to access the value (data) of this field "test" and
used Field.Data property which gives a runtime error.
Pls advise what I am doing wrong. How can i access data of
a property.
Thanks.
I have a custom property name "test" whose value
is "great" in one of my word document which is in word
2000.
I am opening the word document thru a c# application and
then added that field into the document using following
code.
Word.Selection sln = aDoc.ActiveWindow.Selection;
(aDoc.Paragraphs.Count).Range;
object fieldType = Word.WdFieldType.wdFieldEmpty;
object text = "DOCPROPERTY \"test\" ";
object objTrue = true;
Word.Field fld;
fld = sln.Fields.Add(sln.Range, ref fieldType, ref text,
ref objTrue);
MessageBox.Show("Field data " + fld.Data); //runtime error.
I want to access the value (data) of this field "test" and
used Field.Data property which gives a runtime error.
Pls advise what I am doing wrong. How can i access data of
a property.
Thanks.