Protecting docs from changes?

E

Ed

I use a macro to slice and dice a text doc into about 7,000+ separate docs.
These are linked to from a spreadsheet. Both the spreadhseet and the docs
are on a company-wide server.

It has just dawned on me that none of these documents are protected in any
way against the users screwing them up! I put read-only code in the
spreadsheet, but I didn't think about these. Is there an easy way to add a
line or two of code to the SaveAs part of my code that will make each
document read-only? Or some similar type of protection against inadvertant
changes? (Like: the user highlights and copies a section, then fumbles
Ctrl+W and doesn't otice he's accidentally replaced half a doc with "z"!)

Thank you for helping.

Ed
 
M

Mark Tangard

Hi Ed,

You can't set the read-only property during a Save As, since
the file is open. But you can do it afterward very easily.
Look up the SetAttr statement in VBA help.
 
K

Kemosabe

I use a macro to slice and dice a text doc into about 7,000+ separate docs.
These are linked to from a spreadsheet. Both the spreadhseet and the docs
are on a company-wide server.

It has just dawned on me that none of these documents are protected in any
way against the users screwing them up! I put read-only code in the
spreadsheet, but I didn't think about these. Is there an easy way to add a
line or two of code to the SaveAs part of my code that will make each
document read-only? Or some similar type of protection against inadvertant
changes? (Like: the user highlights and copies a section, then fumbles
Ctrl+W and doesn't otice he's accidentally replaced half a doc with "z"!)

Thank you for helping.

Ed

Look up the SaveAs Method in the VBA help file. Your answer is there.
Specifically, you need to use the Password parameter when invoking the
SaveAs Method.
 

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