Batch process to change security of Word docs?

P

pjs

(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
 
D

Doug Robbins - Word MVP

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.

--
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
 
P

pjs

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
 
H

Helmut Weber

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.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

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

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