Solved

Databases and OLE File Linking

Posted on 1997-09-03
3
148 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 50 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

Independent Software Vendors: 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

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 my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

688 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