Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] a.fawcett@bridgelegal.com.au is offline
external usenet poster
 
Posts: 10
Default How do you stop a Macro from opening old files as Read Only?

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

  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Pat Garard Pat Garard is offline
external usenet poster
 
Posts: 301
Default How do you stop a Macro from opening old files as Read Only?

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. (FileOpen,
Read Only - NO, FileSave As, make sure Read Only is NOT set and
save with the same path and filename.
--
Regards,
Pat Garard
Melbourne, Australia
_______________________

wrote in message
ps.com...
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



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro execution using MailMerge nelsonj Mailmerge 9 June 13th 06 05:04 PM
WORD 2002: How to stop recording Word Macro to allow for user inpu Hershmab Microsoft Word Help 1 April 6th 06 01:41 PM
Windows XP should allow me to read power point files sent in ema. Arni Tables 1 March 1st 06 11:54 PM
Macro upon opening in a form Kelly Microsoft Word Help 1 February 7th 05 09:41 PM
Word opening files Read Only when not Nate Weldon Microsoft Word Help 1 January 21st 05 02:37 AM


All times are GMT +1. The time now is 03:42 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"