Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2006

Tip: Looking for answers? Try searching our database.

'Word 2003, Check if selection is protected.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jans__@hotmail.com - 16 Oct 2006 11:32 GMT
Hi there,

I would like to know if the selected text is protected and if it is
protected, how it is protected.

Is there code to do this.

Is there code simulair to the document protectiontype -
Activedocument.Protectiontype -

But now I would like to know if the selection is protected in de
document?
msgbox selection.editortype????? or something like this

Can someone help me with this.

Thanx,

Jans
Doug Robbins - Word MVP - 16 Oct 2006 19:47 GMT
You can tell if it is protected for forms by using the following which will
return True if that is the case:

Selection.Sections(1).ProtectedForForms

I am not sure that the other forms of protection can be detected.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Hi there,
>
[quoted text clipped - 15 lines]
>
> Jans
jans__@hotmail.com - 17 Oct 2006 09:33 GMT
This only tells me if the section has any protection.

I would like to know if the selection has any protection.
I was hoping that there would be an information instruction or
something like that.

Jans
Tony Jollans - 17 Oct 2006 10:39 GMT
If a document is protected for forms you cannot select protected areas so
the question doesn't need asking.

If a document is protected for comments any selection in the main document
is protected by definition so, again, the question doesn't need asking.

So the only issue is Word 2003's read-only protection. I don't know off the
top of my head and don't have 2003 in front of me but I don't think there's
an easy way. You might to be able to work something out using the range
result of gotoeditablerange compared to the selection.

--
Enjoy,
Tony

> This only tells me if the section has any protection.
>
[quoted text clipped - 3 lines]
>
> Jans

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.