FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Opening word-documents read-only with OLE
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Opening word-documents read-only with OLE
Posted: Fri Nov 07, 2008 03: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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Opening word-documents read-only with OLE
Posted: Fri Nov 07, 2008 03:13 PM

Michel,

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

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Opening word-documents read-only with OLE
Posted: Fri Nov 07, 2008 05:01 PM

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

EMG

Posts: 310
Joined: Sun Jan 08, 2006 10:09 PM
Opening word-documents read-only with OLE
Posted: Fri Nov 07, 2008 05:02 PM
Friend,

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


Example:
  ...
   oWord:FileOpen("C:\MY DOCUMENTS\MYWORD.DOC" , , 2 )
  ...
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Opening word-documents read-only with OLE
Posted: Fri Nov 07, 2008 05:11 PM

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

EMG

Posts: 300
Joined: Wed Jul 11, 2007 11:06 AM
Opening word-documents read-only with OLE
Posted: Sun Nov 09, 2008 08: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

Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Opening word-documents read-only with OLE
Posted: Mon Nov 10, 2008 01: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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Continue the discussion