Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 315
  • Last Modified:

D1 - How to view Word 6 documents from Delphi? (read only mode)

(D1 and Win 3.1) I want to enable viewing Winword 6 documents from my Delphi application. I can use for instance OLE container, but how to implement read only mode? The user should be able to see the document, scroll through all its pages but not to change its content.
Thank you.
0
shrldu
Asked:
shrldu
1 Solution
 
icampbe1Commented:
Use the Microsoft WordView program.  It is FREE.  It has all the functionality  of 'Word' but it does not allow modification of the document.
You can launch it from your program like:
   WinExec( path+'WordView.Exe '+YourFile,  SW_ShowNormal );

I believe this is exactly what you are looking for.  This is free from Microsoft.
0
 
hpiersonCommented:
If your user already has word on their PC, add the unit

shellapi

to your uses clause.

the follwoing two lines will do what you want:

filesetattr('c:\yourdir\yourdoc.doc', faReadOnly);
shellexecute(application.handle, 'OPEN'#0, 'c:\yourdir\yourdoc.doc'#0, NIL, 'c:\yourdir'#0, sw_showmaximized);

Your user will be able to make changes in the document on the screen, but will not be able to overwrite yourdoc.doc if they try to save.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now