How do you stop a Macro from opening old files as Read Only?

A

a.fawcett

Hi guys,

I have just started a new job and have created macro's for the staff to
simply click a button (ie "Letterhead") and a read only of the
precedent (ie the letterhead) appears. This is working fantastically
EXCEPT:

If you try and open an old document that is a letterhead (regardless of
whether it is read only or template) it prompts you to either click
"read only" or to enter the password to edit that document.

I only want the password function to the precedents themselves (in
order to prevent them from being edited accidently). I don't want the
password function when you try to call up a previously saved document.

Here is a sample of the current macro for our letterhead:

---------------------------------------------------------------------------------------------------------------------------------------
Sub Letterhead()
'
' Letterhead Macro
' Macro recorded 17/07/2006 by AFawcett
'
Documents.Open FileName:="M:\BL Templates\blletterhead.dot",
ConfirmConversions:=False, _
ReadOnly:=True, AddToRecentFiles:=False, PasswordDocument:="",
_
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="",
_
WritePasswordTemplate:="", Format:=wdOpenFormatAuto,
XMLTransform:=""
Selection.MoveRight Unit:=wdCharacter, Count:=16
Selection.MoveLeft Unit:=wdCharacter, Count:=3
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
---------------------------------------------------------------------------------------------------------------------------------------

Does anyone know how to stop the "read only or enter password" box
prompting up every time you try and open and old document?

Any advice would be appreciated as I am a novice and have run out of
idea.

Many thanks,

Adam
 
P

Pat Garard

G'Day Adam,

1.0 I'm afraid that you are going about this the wrong way. To create
a new DOCUMENT based on a TEMPLATE ...

Documents.Add Template:="M:\BL Templates\blletterhead.dot" _
, NewTemplate:=False, DocumentType:=0

... you do not need to OPEN the TEMPLATE to create a new document.

You do not have to set the READ ONLY recommendation in WORD Templates.

If you are concerned that users might deliberately open Templates, they can
be stored in a Read-Only Folder or marked as Read-Only (file properties)
to prevent changes - talk to your System Administrator.

2.0 Old documents that have been saved in WORD with the READ-
ONLY recommendation set, will always require the user to choose
"Ready Only" or "No" when opened (Documents.Open FileName:="....).
This is a "discretionary" setting to prevent accidental editing and
requires
user interaction. If you want users to be able to edit documents without
this interaction, remove the Read-Only recommendation. (File>Open,
Read Only - NO, File>Save As, make sure Read Only is NOT set and
save with the same path and filename.
 

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