Page 1 of 1

Opening word-documents read-only with OLE

Posted: Fri Nov 07, 2008 3:09 pm
by driessen
Hello,

Can anyone tell me how to open a word-document read-only using OLE ?

Thanks a lot in advance for any help.

Posted: Fri Nov 07, 2008 3:13 pm
by James Bott
Michel,

I don't know the answer to your question, but have you considered just converting them to PDFs?

James

Re: Opening word-documents read-only with OLE

Posted: Fri Nov 07, 2008 5:01 pm
by Enrico Maria Giordano
Hint: the Open() method has a ReadOnly parameter.

EMG

Posted: Fri Nov 07, 2008 5:02 pm
by Rochinha
Friend,

Sintaxis:

Code: Select all

  ...
  oWord:FileOpen( cDOCName [, nConfirmConversions [, nReadOnly ;
                           [, nAddToMru [, cPasswordDoc [, cPasswordDot [, 
                           nRevert ;
                           [, cWritePasswordDoc [, cWritePasswordDot]]]]]]]] )
  ...
Example:

Code: Select all

  ...
   oWord:FileOpen("C:\MY DOCUMENTS\MYWORD.DOC" , , 2 )
  ...

Posted: Fri Nov 07, 2008 5:11 pm
by Enrico Maria Giordano
FileOpen() is not a method of Word, or at least it is not documented in the official Word OLE docs.

EMG

Posted: Sun Nov 09, 2008 8:35 pm
by Jack
Here is what i use :

owrd:=Toleauto():new("word.application")
owrd:visible:=.T.
owrd:Documents:open("test.doc",,1) && avec ouverture read only


Ph Jacquet Belgium

Posted: Mon Nov 10, 2008 1:09 am
by driessen
Philippe,

Thanks a lot.

This was the solution I was looking for.