Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Thu, 16 Mar 2006 23:15:46 +0530,    group: microsoft.public.word.vba.customization        back       


prompt user text protected if tries to edit using vba code   
I have protected parts of a document/paragraphs so that only
headers/footers and certain paragraph can be edited.  I have used vba
code to turn off highlight and bookmarks of editable text so the
document looks all the same *but now want a message to appear if user
tries to edit protected region in word 2003*.  

I am not certain if there is any code that if protected selection text
selected a message box appears to inform user they are not able to edit
it and use code to automatically return to paragraph 1.

This is required as certain paragraphs in the template are health &
safety and should not be amended.  This way, it ensures no one can
unless they have password to unprotect the document.

Many thanks
Christine


-- 
christine
Posted from - http://www.officehelp.in
date: Thu, 16 Mar 2006 23:15:46 +0530   author:   christine

Re: prompt user text protected if tries to edit using vba code   
> This is required as certain paragraphs in the template are health &
> safety and should not be amended.  This way, it ensures no one can
> unless they have password to unprotect the document.

Note, you cannot ensure that someone without passwords cannot edit your 
text. You can only make it difficult (and not all that difficult). If 
someone can read it, they can copy it. If they can copy it, they can edit 
it.

By "highlight" I assume you mean select. Highlight, in Word, means to give a 
background color as if you used a highlighter or printed text.

If they aren't supposed to edit it, why is it editable?

Monitoring individual keystrokes and mouse movements via vba is very 
resourse intensive.

Since you can't have real security anyway, why not simply use an online form 
and skip the vba? This protects headers and footers, makes text in protected 
sections so that it can't be selected, and seems to meet your other needs. 
(It is still not secure, even if protected by a password.)

For more about online forms, follow the links at 
http://addbalance.com/word/wordwebresources.htm#Forms or 
http://word.mvps.org/FAQs/Customization/FillinTheBlanks.htm especially Dian 
Chapman's series of articles. You may also want to look at 
http://www.word.mvps.org/FAQs/TblsFldsFms/LinesInForms.htm.

Hope this helps,
-- 
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of 
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
 --------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.


"christine"  wrote in message 
news:christine.24rxru@NoSpamPleaze.com...
>
> I have protected parts of a document/paragraphs so that only
> headers/footers and certain paragraph can be edited.  I have used vba
> code to turn off highlight and bookmarks of editable text so the
> document looks all the same *but now want a message to appear if user
> tries to edit protected region in word 2003*.
>
> I am not certain if there is any code that if protected selection text
> selected a message box appears to inform user they are not able to edit
> it and use code to automatically return to paragraph 1.
>
> This is required as certain paragraphs in the template are health &
> safety and should not be amended.  This way, it ensures no one can
> unless they have password to unprotect the document.
>
> Many thanks
> Christine
>
>
> -- 
> christine
> Posted from - http://www.officehelp.in
>
date: Thu, 16 Mar 2006 12:51:31 -0600   author:   Charles Kenyon

Re: prompt user text protected if tries to edit using vba code   
The new documents are procedures which have related health and safety. 
I protected the health and safety statements and when user opens
template they can create a new procedure with standard health and
safety statements already inserted for doing certain tasks.  they need
to access headers as they have document ID.
The 'highlight' I was relating to is stated on the 'protect document'
taskpane and all editable text is highlighted and has bookmarked when
new doc created from template.  This was off putting to some procedure
writers so I used AutoExec code to take off 'shading' and bookmarks
when new doc opened.  The users can copy and paste but I customised the
template menu so they cant do by Edit toolbar by taking off 'save' and
copy/paste.  They could of course use keyboard shortcuts but they would
still have to create a document that is exactly the same style as the
template which would take them quite some time. 
I will check out some keystroke code to see if text is not editable
then msgbox and return to paragraph.

thanks for your comments.


-- 
christine
Posted from - http://www.officehelp.in
date: Fri, 17 Mar 2006 16:09:15 +0530   author:   christine

Re: prompt user text protected if tries to edit using vba code   
You do not want AutoExec code but AutoNew or AutoOpen code. AutoExec does 
not run in a document template.

You could use a UserForm to get a document ID and insert it into a 
Header/Footer, allowing you to protect the document for forms.
-- 
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of 
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
 --------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.


"christine"  wrote in message 
news:christine.24t96l@NoSpamPleaze.com...
>
> The new documents are procedures which have related health and safety.
> I protected the health and safety statements and when user opens
> template they can create a new procedure with standard health and
> safety statements already inserted for doing certain tasks.  they need
> to access headers as they have document ID.
> The 'highlight' I was relating to is stated on the 'protect document'
> taskpane and all editable text is highlighted and has bookmarked when
> new doc created from template.  This was off putting to some procedure
> writers so I used AutoExec code to take off 'shading' and bookmarks
> when new doc opened.  The users can copy and paste but I customised the
> template menu so they cant do by Edit toolbar by taking off 'save' and
> copy/paste.  They could of course use keyboard shortcuts but they would
> still have to create a document that is exactly the same style as the
> template which would take them quite some time.
> I will check out some keystroke code to see if text is not editable
> then msgbox and return to paragraph.
>
> thanks for your comments.
>
>
> -- 
> christine
> Posted from - http://www.officehelp.in
>
date: Fri, 17 Mar 2006 08:51:32 -0600   author:   Charles Kenyon

Re: prompt user text protected if tries to edit using vba code   
Thanks Charles - I wanted to use a form but asked if I could come up
with another way as the 'writers' didnt like.  I have used the
autoOPEN, which seems to only work if I actual open the template so I
am going to try autoNEW and use the code in 'private sub document new'
and see if it will run when a new document created based on the
template.
Thank you very much for your input.


-- 
christine
Posted from - http://www.officehelp.in
date: Tue, 21 Mar 2006 00:32:44 +0530   author:   christine

Re: prompt user text protected if tries to edit using vba code   
While there is a lot to not like about online forms, my guess is that the 
writers didn't like the lack of spell-check. This can be added in if that is 
their problem. 
http://www.mvps.org/word/FAQs/MacrosVBA/SpellcheckProtectDoc.htm

-- 
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
 --------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
"christine"  wrote in message 
news:christine.24zhy2@NoSpamPleaze.com...
>
> Thanks Charles - I wanted to use a form but asked if I could come up
> with another way as the 'writers' didnt like.  I have used the
> autoOPEN, which seems to only work if I actual open the template so I
> am going to try autoNEW and use the code in 'private sub document new'
> and see if it will run when a new document created based on the
> template.
> Thank you very much for your input.
>
>
> -- 
> christine
> Posted from - http://www.officehelp.in
>
date: Mon, 20 Mar 2006 15:44:27 -0600   author:   Charles Kenyon

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us