Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Databases and OLE File Linking

Posted on 1997-09-03
3
Medium Priority
?
150 Views
Last Modified: 2010-04-04
I am writing a Database application using Delphi 2. The user wants (for each record) to be able to include a MS Word document (possibly more than one) and maybe a graphic file (bitmap), again, possibly more than one.

I don't want to embed them in each record, I want to save a link to each file. I first thought of the OLEContainer, but this thing can only hold one object at any one time. I could just save the path and filename of the proposed file(s) in each record, but how could I execute the application (eg. Word) when the user wants to edit the file.

I'd like to use the InsertOLEObject Dialog box, so the user can insert an object (of their choice) at any time.

How, and what would be the best way to do this?
0
Comment
Question by:rocknroll
[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 8

Accepted Solution

by:
ZifNab earned 100 total points
ID: 1343539
Hi rocknRoll,

For executing word :

First you have to include OleAuto in your unit's uses clause, and
declare a Variable for the OLE object, like:

  var
    MsWord: Variant;

And then:

  begin
    MsWord:=CreateOleObject('Word.Basic');
    MsWord.AppShow;     {if you want word to show}
    MsWord.FileOpen('your_file.doc');
    MsWord.Insert('some text');
  end;

Don't know exactly if this is what you need, hope it is

Have fun,
c.u. ZifNab;
0
 

Author Comment

by:rocknroll
ID: 1343540
Thanks ZifNab,

what you suggested seems to work, but I have another little problem. While the user is editing a document in Word (opened by my application), and the user saves this document under another name, how can I obtain this new filename so I can change the link to it. Are there any parameters returned from Word once it is closed and my application gains control again?

0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1343541
Hi R&R,

Sorry, I don't know a answer for this question, but I'll look at it. I'm going on a trip for a week or 2, so if you can wait till then. But i promise that i'll look at it!

c.u. ZifNab
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

597 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