Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

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

Posted on 1997-06-10
2
Medium Priority
?
310 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 400 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

647 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