Create editable document with permanent fields in Word 2003

M

Morgan

Hello all,

I'm going nuts trying to figure out how to create templates that
populate from a data source, are completely editable, yet also have
some way of marking and retrieving text from the populated locations
in the document.

The obvious answer to this is to use either form fields or bookmarks,
since they both contain ranges and they can both be referenced with an
associated name property. And they do indeed work, but they are easy
to unintentionally delete by the users, which makes later parsing and
retrieval of text from said fields impossible.

I ran across one interesting idea to get around this limitation, which
is to assign each form field its own section, and then to set those
sections to ProtectedForForms = True. This ALMOST worked - which is,
of course, even more frustrating than total failure :).
Unfortunately, Word can't have multiple section breaks - even
continuous section breaks - in a single line, and a number of my
templates need to have four or five fields in close proximity. Having
line breaks between them would be unacceptable for many of the
templates, particularly the legal documents.

A similar limitation occurs with bookmarks, but there I can't both
protect the bookmark and assure that it won't be typed over
accidentally. If I protect them then they can't be manually edited,
but if I don't it only takes one long select and over-type and they're
gone.

I had previously been using Document Property fields to populate the
document using the Custom Document Properties, auto-updating them,
then detaching the fields from their references to make them
editable. The problem is that once that's been done, I can't
programmatically retrieve information from those fields, which makes
future data gathering impossible - or manual, which is essentially the
same for me :)

I came up with a little function to find and store the index locations
of each field in the document for later reference if I ended up having
to use a type of field that doesn't have a name property - like a
Quote field, for example - but I always end up running into the
protection issue.

The only thing I can think of other than that is to have the field
areas linked to button-type macros that activate on double-click, but
it would be a huge pain to convert all of my templates to use such a
system, and I really don't like the idea of implementing such a code-
intensive task for every field in a document if it's at all possible
to avoid it.

If necessary, I'll just eschew my dreams of data retrieval and stick
with the Document Property fields, but I'd *really* prefer not to.

Surely this isn't such a wild concept - can anyone help?

Thanks,
Morgan
 
F

fumei via OfficeKB.com

You have a problem.

PART of the problem is, frankly, education of your users. "unintentionally
delete" is an issue I understand, but unfortunately, you can not have it both
ways.

If the document is "completely editable", then that means exactly that. They
can.

What you are asking for is that it is "completely editable".....except for
some things. Well, completely either means completely, or it doesn't.

In your example of fields: "my templates need to have four or five fields in
close proximity.", I understand you do not wish line breaks where you do not
want them. The issue there is do your users NEED to be able to edit BETWEEN
those fields?

If they do not, then make that chunk of four or five fields protected.

If they do....then again...you have a problem.

I see no way to truly get around it if a requirement, a real requiremnt, is
that the document is "completely editable".
 
J

Jean-Guy Marcil

Morgan said:
Hello all,

I'm going nuts trying to figure out how to create templates that
populate from a data source, are completely editable, yet also have
some way of marking and retrieving text from the populated locations
in the document.

The obvious answer to this is to use either form fields or bookmarks,
since they both contain ranges and they can both be referenced with an
associated name property. And they do indeed work, but they are easy
to unintentionally delete by the users, which makes later parsing and
retrieval of text from said fields impossible.

I ran across one interesting idea to get around this limitation, which
is to assign each form field its own section, and then to set those
sections to ProtectedForForms = True. This ALMOST worked - which is,
of course, even more frustrating than total failure :).
Unfortunately, Word can't have multiple section breaks - even
continuous section breaks - in a single line, and a number of my
templates need to have four or five fields in close proximity. Having
line breaks between them would be unacceptable for many of the
templates, particularly the legal documents.

A similar limitation occurs with bookmarks, but there I can't both
protect the bookmark and assure that it won't be typed over
accidentally. If I protect them then they can't be manually edited,
but if I don't it only takes one long select and over-type and they're
gone.

I had previously been using Document Property fields to populate the
document using the Custom Document Properties, auto-updating them,
then detaching the fields from their references to make them
editable. The problem is that once that's been done, I can't
programmatically retrieve information from those fields, which makes
future data gathering impossible - or manual, which is essentially the
same for me :)

I came up with a little function to find and store the index locations
of each field in the document for later reference if I ended up having
to use a type of field that doesn't have a name property - like a
Quote field, for example - but I always end up running into the
protection issue.

The only thing I can think of other than that is to have the field
areas linked to button-type macros that activate on double-click, but
it would be a huge pain to convert all of my templates to use such a
system, and I really don't like the idea of implementing such a code-
intensive task for every field in a document if it's at all possible
to avoid it.

If necessary, I'll just eschew my dreams of data retrieval and stick
with the Document Property fields, but I'd *really* prefer not to.

Surely this isn't such a wild concept - can anyone help?

If you can wait until all those involved with editing/maintaining the
documents you a referring to can use Word 2007, then you can use Content
Controls which can be set to "Cannot be deleted".

See Greg Maxey's tip page on these controls:
http://gregmaxey.mvps.org/Mapped_Content_Control.htm

Later, if you really need to (or want to!), you can use XML to retrieve/set
the information in the content controls...
 
M

Morgan

You have a problem.

PART of the problem is, frankly, education of your users. "unintentionally
delete" is an issue I understand, but unfortunately, you can not have it both
ways.

Yeah, they're of the triple-P type: "picky, petulant and powerful".
If the document is "completely editable", then that means exactly that. They
can.

Perhaps a poor choice of wording. What I mean is that I'd like the
text in the fields to be able to be manually edited, and the text of
the document to be manually edited.
What you are asking for is that it is "completely editable".....except for
some things.
Exactly

In your example of fields: "my templates need to have four or five fields in
close proximity.", I understand you do not wish line breaks where you do not
want them. The issue there is do your users NEED to be able to edit BETWEEN
those fields?

Probably not, but again with legal documents every little word can
sometimes be crucial. Based on your response, though, I'm starting to
think that the only way to do this properly is to protect chunks of
the document without a password and instruct the users to "unlock and
be careful" if they need to edit within those sections AND outside of
the fields. I foresee complaints, but as you point out, there are
some things that can't be done.

I very much appreciate the quick response. If there are other ideas
out there I'd love to hear them, but I think I see where this will all
end up.

Thanks!
Morgan
 
M

Morgan

If you can wait until all those involved with editing/maintaining the
documents you a referring to can use Word 2007, then you can use Content
Controls which can be set to "Cannot be deleted".

Dare to dream...
Unfortunately I work in a real estate lending company, so a company-
wide Office 2007 upgrade will probably be scheduled for right after
our ski vacation in Hell.

I really do need to learn XML, though.
 
J

Jean-Guy Marcil

Morgan said:
Dare to dream...
Unfortunately I work in a real estate lending company, so a company-
wide Office 2007 upgrade will probably be scheduled for right after
our ski vacation in Hell.

LOL.
Just after my company's brunch offering pig-buffalo wings!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top