There's no such thing as a stupid question, but they're the easiest to answer.


Business Applications Business Applications
Search Search
Search for:
Tech Support Guy > > >

VBA to save Word as Read-Only


dgetz's Avatar
dgetz dgetz is offline
Junior Member with 5 posts.
Join Date: Aug 2001
10-Jan-2002, 12:11 PM #1
Question [SOLVED] VBA to save Word as Read-Only
Anyone know how to save the active document as read-only using VB? ActiveDocument.ReadOnly = True doesn't work because the document is already open.


Actually, I figured out a way to do it:
ActiveDocument.WritePassword = "your_password_here"

This will then cause the document to open up with three options: open (to be able to edit), read-only, and cancel. To be able to open the file, you have to enter the password.

Of course, make sure to protect your code otherwise, anyone could just look at the code and see the password to edit the document.

Last edited by dgetz; 10-Jan-2002 at 02:52 PM..
johnhouk's Avatar
johnhouk johnhouk is offline
Junior Member with 17 posts.
Join Date: Dec 2001
15-Jan-2002, 11:40 AM #2
Not Sure if this will help or not but...
I recorded a macro and checked the "Read Only Recommended"
Then looked @ the code.
I saw:

ActiveDocument.ReadOnlyRecommended = True
dgetz's Avatar
dgetz dgetz is offline
Junior Member with 5 posts.
Join Date: Aug 2001
15-Jan-2002, 06:00 PM #3
Actually, this only recommends that the user opens as read only (I believe). It does not force them to open it as read only. The above code will force them to enter the password if they want to edit it.
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

You Are Using: Server ID
Trusted Website Back to the Top ↑

Content Relevant URLs by vBSEO 3.3.2