T
theWatcher
Hello
I am writing a VB6 app that opens a Word document (Word XP) and populates the
pre-existing Doc Variables with data from a database. The user is then able to
edit the text and/or formatting (italics, superscript, bold, etc.) of these
fields. Once the changes have been made, the VB app needs to extract the
modified data from the specific fields (text and/or formatting), analyze it, and
store it in the database so that the exact document may be reproduced at a later
date. The questions I have are
1. How do I extract the modified data from the doc variable fields? The
Variables("varname").Value property only contains the data I originally sent to
it and seems not to be dynamically linked to the field on the document. The
closest I have come is to use the Fields(x).Select and Selection.Text
combination, but I'd rather have access to the named variables, since
Fields(1,2,3...) may not refer to the same information in every document
2. How do I identify formatting changes in a specific field? If the user
simply changes normal text to italicized, I need to capture that change as well
3. How do I extract formatting codes from Word so that the formatted text can
be preserved in a database for future reproduction? How do I read that
formatted data into Word later to reproduce the exact document? (Is this
HTML-type formatting?
4. How do I interrupt or Cancel the Close event in Word? I do not want for the
user to be able to close the document before the app has a chance to process the
data, so I have hidden all of the Close/Save functions in the File menu, but the
Close button (X) at the top, right of the screen still exists. I want to cancel
the close event (similar to Canceling the FormUnload event for VB forms), but
have been unable to find one for Word
Thank you for any help you can provide.
I am writing a VB6 app that opens a Word document (Word XP) and populates the
pre-existing Doc Variables with data from a database. The user is then able to
edit the text and/or formatting (italics, superscript, bold, etc.) of these
fields. Once the changes have been made, the VB app needs to extract the
modified data from the specific fields (text and/or formatting), analyze it, and
store it in the database so that the exact document may be reproduced at a later
date. The questions I have are
1. How do I extract the modified data from the doc variable fields? The
Variables("varname").Value property only contains the data I originally sent to
it and seems not to be dynamically linked to the field on the document. The
closest I have come is to use the Fields(x).Select and Selection.Text
combination, but I'd rather have access to the named variables, since
Fields(1,2,3...) may not refer to the same information in every document
2. How do I identify formatting changes in a specific field? If the user
simply changes normal text to italicized, I need to capture that change as well
3. How do I extract formatting codes from Word so that the formatted text can
be preserved in a database for future reproduction? How do I read that
formatted data into Word later to reproduce the exact document? (Is this
HTML-type formatting?
4. How do I interrupt or Cancel the Close event in Word? I do not want for the
user to be able to close the document before the app has a chance to process the
data, so I have hidden all of the Close/Save functions in the File menu, but the
Close button (X) at the top, right of the screen still exists. I want to cancel
the close event (similar to Canceling the FormUnload event for VB forms), but
have been unable to find one for Word
Thank you for any help you can provide.