Solved

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

Posted on 1997-06-10
2
292 Views
Last Modified: 2010-04-06
(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
Comment
Question by:shrldu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
icampbe1 earned 100 total points
ID: 1336959
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
 
LVL 3

Expert Comment

by:hpierson
ID: 1336960
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question