Word 2007 - Prevent users from changing document

J

jo

I am working on an VSTOSE Word Add-in. (Word 2007)

I have several content controls which are locked for editing and have
no problems with these areas being locked. I have noticed however,
that if the user is in one of the content controls and uses the move
right arrow - this will move them out of the content control. The user
can then insert text, etc. I have tried grouping the controls but the
user seems to be able to move the cursor outside of the protected area
and insert text. How do I lock down areas outside the content controls
and group?
 
J

Jay Freedman

jo said:
I am working on an VSTOSE Word Add-in. (Word 2007)

I have several content controls which are locked for editing and have
no problems with these areas being locked. I have noticed however,
that if the user is in one of the content controls and uses the move
right arrow - this will move them out of the content control. The user
can then insert text, etc. I have tried grouping the controls but the
user seems to be able to move the cursor outside of the protected area
and insert text. How do I lock down areas outside the content controls
and group?

I'm not a VSTO user -- yet -- so I can't give a code example, but here's how
you do it in the UI: After creating your content controls and static text,
select the entire document and insert a Rich Text content control to contain
the whole thing. Set that outer container to disallow editing and to
disallow deletion of the control. The inner controls will permit whatever
operations they were configured for, but everything else will be locked
down.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
J

jocrews

Thanks Jay - I'll give it a try.

Jay Freedman said:
I'm not a VSTO user -- yet -- so I can't give a code example, but here's how
you do it in the UI: After creating your content controls and static text,
select the entire document and insert a Rich Text content control to contain
the whole thing. Set that outer container to disallow editing and to
disallow deletion of the control. The inner controls will permit whatever
operations they were configured for, but everything else will be locked
down.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
P

Perry

Eventhough Jay input is valid:

I wouldn't rely on Office 2007 PIA's in relation to VB.net 2005 SE being in
place now.

My opinion:
wait until a strong confirmation/committment on MS' side is published to
implement this "business" solution.
Uptil now: I've haven't seen a string committment from MS being published
.............
(did you ? )

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE
 
S

Scott McPhillips [MVP]

I'm not a VSTO user -- yet -- so I can't give a code example, but here's how
Very Clever! :)
Thanks!
(I had this problem too, and solved it in a much more convoluted way.)
 
J

Jay Freedman

Very Clever! :)
Thanks!
(I had this problem too, and solved it in a much more convoluted way.)

I'd like to take credit for it, but I can't... I got it from a
presentation/demonstration by one of the MS program managers. I think
it was the development team's intention that this would be the
standard method, but the documentation of content controls hasn't
really come up to speed yet.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 

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