[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Launching WP documents from within application

Posted on 1997-06-24
3
Medium Priority
?
176 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 150 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

825 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