Solved

Launching WP documents from within application

Posted on 1997-06-24
3
168 Views
Last Modified: 2010-04-04
I am new to Delphi (1.0). I have a small database application which stores a word processor document related to each entry. I want to be able to launch and view these documents from within the application. I have played with ShellExecute, but can't get it to work. Is ShellExecute the answer or is there another way?

Thanks.
 JohnE
0
Comment
Question by:JohnE
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
ronit051397 earned 50 total points
ID: 1337732
Yes, ShellExecute is one of the posibilities, Example:

uses ShellApi;

procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(Handle,'open','c:\ronit\document1.doc','','',SW_SHOW);
end;

0
 

Author Comment

by:JohnE
ID: 1337733
Thanks ronit. This is along the lines I have been trying. What I really need is an extension of this anwer. The document changes with each record. How do I modify your anwser to be able to execute with document names that change with each database record?
0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1337734
If you use shellexecute and word is not loaded, then it is loaded and opens the document you specified.
If word is allready loaded then it is not loaded twice, only opens the document you specified. Do you want to Know how to close the last document before opening another one?
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 Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 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

11 Experts available now in Live!

Get 1:1 Help Now