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 2005

Tip: Looking for answers? Try searching our database.

Batch process to change security of Word docs?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pjs - 26 Oct 2005 17:59 GMT
(also posted in Word General)

Is there a way to automate changing the security option of standard Word
documents to make them read only or password protected? It's easy enough to
do one by one (Tools --> Options --> Security) but I'd go crazy having to do
this for several hundred. I'm using Word 2003 on a Windows XP platform.

Thanks.

pjs
Doug Robbins - Word MVP - 26 Oct 2005 20:47 GMT
You could modify the code in the macro in the article "Find & ReplaceAll on
a batch of documents in the same folder" at:

http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm

so that it opens each document and then saves it with the read only
attribute set

Check out the SaveAs method in the Visual Basic Help file for the syntax.

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

> (also posted in Word General)
>
[quoted text clipped - 8 lines]
>
> pjs
pjs - 26 Oct 2005 21:06 GMT
Thanks. That might work.

Is script like this modifiable so that it not only works on every file in a
folder, but all teh subfolders as well?

pjs

> You could modify the code in the macro in the article "Find & ReplaceAll on
> a batch of documents in the same folder" at:
[quoted text clipped - 18 lines]
> >
> > pjs
Helmut Weber - 26 Oct 2005 22:30 GMT
Hi,

for "readonly" only,
but lightening fast and no worry with subdirs.

C:\Documents and Settings\Helmut Weber>attrib /?
Displays or changes file attributes.

ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H]
[drive:][path][filename]
      [/S [/D]]

 +   Sets an attribute.
 -   Clears an attribute.
 R   Read-only file attribute.
 A   Archive file attribute.
 S   System file attribute.
 H   Hidden file attribute.
 [drive:][path][filename]
     Specifies a file or files for attrib to process.
 /S  Processes matching files in the current folder
     and all subfolders.
 /D  Processes folders as well.

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

 
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.