Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do list the available OLE objects

Status
Not open for further replies.

sainter

IS-IT--Management
Dec 19, 2001
3
0
0
AU
Is is possible to list the ole objects available on the client PC, as the 'Insert Object' dialog does on general fields?

 
Sure,

Read the registry. Under HKEY_CLASSES_ROOT you'll find a section CLSID
You might find nodes there that look like HKEY_CLASSES_ROOT\CLSID\{0713E8A2-850A-101B-AFC0-4210102A8DA7}
Under those nodes you might find a subnode like INPROCSERVER32 (in this case the treeview), and a node TypeLib.
Those are the keys you should be looking for as they indicate that those things can be ole-automated.
It IS a tedious job and even though I have 17 yrs programming experience I would be hesitating doing a thing like this.

My guess is you want to know whether a certain control is on the clients machine and, if not install that! AM I right?
[wavey2]
 
It had occurred to me to attempt to read the values from the registry, but this did seem to tedious.

The application we are writing allows the users to attach documents to database record(s). The function we wanted to add is to place a comdobox listing the registered document/objects types installed on the PC. The files displayed in a list box are then based on the document type selected. We are trying to avoid using GETFILE or the like. It is a long story why, but we want to ensure that only documents of recognised files formats are listed ( and this may vary from client to client).

 
The application we are writing allows the users to attach documents to database record(s).

So you are thinking about automation? probably through WinWord.
That's quite simple.

Code:
LOCAL lWordInstalled

lWordInstalled= .F.

On error *  && do nothing
oWord = createObject("word.application")
if vartype( oWord) = "U"
   messagebox( "Word not installed!")
else
   lWordInstalled = .T.
   messagebox(" Word IS installed, congrats, good choice!!, 
   you're my man!! HipHipHurray!!")
endif
On Error MyErrorhandler()

* place some code here to retrieve the document.
lcDoc = Getfile("Word document:DOC")

if lWordInstalled and not empty( lcDoc)
   oWord.Documanets.Open(lcDoc)
   oWord.visible = .T.
endif

HTH
Boudewijn[wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top