Solved

Databases and OLE File Linking

Posted on 1997-09-03
3
144 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
  • 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi: how to send PJL commands to printer 3 97
Intraweb download file link ? 1 132
SUM 2 INTEGER ARRAYS INTO 1 10 100
JAudiorecorder record freezing the app 29 67
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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 Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

786 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