Solved

Launching WP documents from within application

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
System restore point 4 91
How to open a new windows chrome resized and disabled the toolbar? 3 83
Multiple image collision 13 69
how can i search if string exist in array ? 3 50
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…
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

863 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

27 Experts available now in Live!

Get 1:1 Help Now