You could 'break' your doc into sections and only protect the sections
you need.
Next time it would be more helpful if you posted all the code. Also it's
confusing when you say
> I have already got code in place to unprotect the document, the user is
> able to enter data into the form fields on the form
Those are two separate issues. Unprotecting the document doesn't let the
user enter data into form fields, users can (and usually do) enter form field
data in *protected* documents. You unprotect when you want to change
non-field content or format, or to access certain document properties like
CustomDocumentProperties or other information.
Like I said, if you want your code to manipulate anything other than field
contents or get position information in a protected document, you have to
unprotect it first. If you do in fact have unprotect code in your sub that
unprotects *before* you try to get information like insertion point position,
then there shouldn't be any problem.
Your
> I have already got code in place to unprotect the document, the user is
> able to enter data into the form fields on the form whilst it is
> locked, (essentially a questionnaire with form field tickboxes etc),
> which is working as intended, but it does mean they cant select a row
> in the table, or a cell.
ChrisC - 15 Jun 2005 16:53 GMT
Sorry for the confusion.
>From the word go I have been unprotecting the document in the code
before accessing the properties I need, however I have been getting the
results of -1 etc that I have previously described. I have tried
expanding the selection to see if i could get hold of a cell within it
or something but that has also met with failure.
To clarify the point that was confused - the document is always
protected from a users perspective. It only gets unprotected when
changes are being made in the code when a user clicks a button or
something similar.
At the moment as a workaround im having to prompt the user for the row
they are using in the table, which is a bit grim. I dont see why im
having these problems - maybe there is a magic 'allow useful settings
information to work' option?
Chuck - 16 Jun 2005 18:37 GMT
Like I said, if you want your code to manipulate anything other than field
contents or get position information in a protected document, you have to
unprotect it first.
If you want your code to return information about the insertion point ...
*_you need to unprotect the document first either using code or asking the
user to do it_*
There is no other way. What you are trying to do, get the information while
the document is protected, simply cannot be done.
> Sorry for the confusion.
>
[quoted text clipped - 13 lines]
> having these problems - maybe there is a magic 'allow useful settings
> information to work' option?