Solved

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

Posted on 1997-06-10
2
272 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
2 Comments
 
LVL 2

Accepted Solution

by:
icampbe1 earned 100 total points
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now