Hello there,
I’m a Dutch developer, evaluating Aspose.Word for possible usage in our next project.
What I need to know is how I can read pieces of text out of a word-document?
Do I need to do this with form-fields? Are there other possibilities?
I just want to make some Word template document with form-fields, or sections or whatever
sor of possible ‘text blocks’.
I just need to be able to read out those text blocks (like form fields).
Is this possible? And if so, how? Is need some example code for this. I couldn’t find it in the demo’s.
-------------------------------------------------
So far, I tried this code below, but I get an error message ‘System.Exception: Cannot find a document field that wraps this form field.’
I’ve just created some test document in Word2002 with some (text)formfields in it (and 1 checkbox-formfield).
Dim word As word = New word
Dim doc As Document = word.Open(MapPath(".") + "…\Documents\testform.doc") 'word.Open("d:\docs\testform.doc")
Dim s As String = doc.Range.Text() ’ goes fine
Dim i As Integer = doc.Range.FormFields.Count ’ error on this line
Dim s3 As String = doc.Range.FormFields("Text1").Result ’ also error on this line
regards,
Martin
----------