I have an application that opens Word 97. I am trying to lock Word so users can't make any chages to the document. Any suggestions on locking the document so changes can't be made?
You could set the file attributes of the document to read-only. You could set a password for making changes but not viewing (I know this can be done in 2000 but am not sure about 97). Depending on the OS and network environment you could set permissions at the OS/Network level. All can be done from within your app too. You might want to be a little more descriptive as to what you really want to do. If you just don't want anybody to be able to modify the document except via your app then setting OS/Network permissions are your best bet as if you just set it to read-only they could always change that if they new how.
Here is a sample of the code I'm using. I'm not for sure how to set it to read only from within the application. I need someway to unlock it so I can add the information to the document then lock it once the Word document is open so changes can't be made.
Thanks in advace...
On Error GoTo ErrorHandler
Dim NumRows As Integer
Dim myTable As Table
Dim X As Integer
Dim WordObject As Object
Set WordObject = CreateObject("Word.application")
MousePointer = vbHourglass
With WordObject
.Documents.Open (ReportDir + "\Document")
.Visible = True
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.