Opening word-documents read-only with OLE

Opening word-documents read-only with OLE

Postby driessen » Fri Nov 07, 2008 3:09 pm

Hello,

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

Thanks a lot in advance for any help.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Postby James Bott » Fri Nov 07, 2008 3:13 pm

Michel,

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

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Opening word-documents read-only with OLE

Postby Enrico Maria Giordano » Fri Nov 07, 2008 5:01 pm

Hint: the Open() method has a ReadOnly parameter.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Rochinha » Fri Nov 07, 2008 5:02 pm

Friend,

Sintaxis:
Code: Select all  Expand view
  ...
  oWord:FileOpen( cDOCName [, nConfirmConversions [, nReadOnly ;
                           [, nAddToMru [, cPasswordDoc [, cPasswordDot [,
                           nRevert ;
                           [, cWritePasswordDoc [, cWritePasswordDot]]]]]]]] )
  ...


Example:
Code: Select all  Expand view
  ...
   oWord:FileOpen("C:\MY DOCUMENTS\MYWORD.DOC" , , 2 )
  ...
Rochinha
 
Posts: 310
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo

Postby Enrico Maria Giordano » Fri Nov 07, 2008 5:11 pm

FileOpen() is not a method of Word, or at least it is not documented in the official Word OLE docs.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Jack » Sun Nov 09, 2008 8:35 pm

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
Jack
 
Posts: 288
Joined: Wed Jul 11, 2007 11:06 am

Postby driessen » Mon Nov 10, 2008 1:09 am

Philippe,

Thanks a lot.

This was the solution I was looking for.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 67 guests