1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Donation with Paypal!!!

    Go to your paypal account and send directly donation to [email protected]

    1 month - 10 $ - Standart VIP

    6 months - 20 $- Standart VIP

    1 year - 30 $- Standart VIP

    2 years - 50 $- Standart VIP

    Gold member for life - 150 $- Standart VIP

    High Vip (Standart VIP include) group please send PM or email to [email protected] for info

    After Donation please send email to [email protected]

  3. Donation Ways 2020


    Paysend
  4. Telegram

  5. Delphifan Magazine
Dismiss Notice

Donation with Paypal!!!

Go to your paypal account and send directly donation to [email protected]

1 month - 10 $ - Standart VIP

6 months - 20 $- Standart VIP

1 year - 30 $- Standart VIP

2 years - 50 $- Standart VIP

Gold member for life - 150 $- Standart VIP

High Vip (Standart VIP include) group please send PM or email to [email protected] for info

After Donation please send email to [email protected]

Dismiss Notice
For open hidden message no need write thanks, thank etc. Enough is click to like button on right side of thread.

Word OLE automation and read-only files

Discussion in 'Delphi Programming' started by nemilose, Oct 22, 2015.

  1. nemilose
    Offline

    nemilose DF Member

    Hi,

    If you open a read-only Word document or a document from email attachment or something else the Word considers that should not be edited, the document opens in some Read-only mode. If you wish to edit this file, there is an option in View->Edit Document. I had a problem how to enter this edit mode via OLE automation from Delphi. After a lot of time, I discovered ReadingLayout property. For example:


    Code:
    var
    WordApplication : Word_TLB._Application;
    WordDocument : Word_TLB._Document;
    begin
    WordApplication := CoWordApplication.Create;
    WordDocument:=WordApplication.Documents.Open('Test.docx',EmptyParam,True,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam);
    WordDocument.ActiveWindow.View.ReadingLayout:=False;
    ...
    
    Off course, read-only mode can be disabled in Word options, but I can not know in advance whether someone has disabled this option or not :)

    Best regards!
     

     

     

     

     

     

     
     
  2. ilanamlas1
    Online

    ilanamlas1 Guest

    fine work
     

Share This Page