Solved

Launching WP documents from within application

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
find a node in VST 2 73
SUM 2 INTEGER ARRAYS INTO 1 10 108
Delphi and Access based Enumeration 9 70
Multi-layered image in FireMonkey 9 48
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

860 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