Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Open Word File as Read Only

Author  Topic 

Hyukevain
Yak Posting Veteran

66 Posts

Posted - 2005-07-05 : 07:11:12
Hi,

How can I open word file using Winword "filename.doc" so the file open as read only mode from my code.
I cannot set the file as read only because when someone open it from word application directly, he/she must still can edit the file.

Thank's

Mike

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2005-07-05 : 12:09:24
As always, more informationa and/or the code you are using currently would be quite helpful. (Are you using the Word object library? Are you using the SHELL command? API calls? etc)

If you are using the Word object library, then you simply set the ReadOnly argument to True when you open the document:

Dim w As New Word.Application
Dim d As Word.Document
w.Visible = True
Set d = w.Documents.Open("filename.doc", , True)

- Jeff
Go to Top of Page

Hyukevain
Yak Posting Veteran

66 Posts

Posted - 2005-07-05 : 21:06:37
Sorry, I forgot.
Thanks Jeff for your quick reply.
First I tried to use shell command, but after I read your post, maybe I'll use Word Object because it more easier to use.
Does Word object for all version of Office same ? Do I need to include it on my package when implementing it ?

Thank's,

Mike
Go to Top of Page
   

- Advertisement -