Solved

Launching WP documents from within application

Posted on 1997-06-24
3
172 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
[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
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

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…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 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