Articles   Members Online: 3
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
Creating an Insertable ActiveX control for Microsoft Office Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
26-Jul-03
Category
ActiveX
Language
Delphi 4.x
Views
180
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Christopher Brandsma

How to create an ActiveX control for Microsoft Office that is "Insertable"

Answer:

There is a nice feature in Microsoft Word that allows you to put ActiveX controls 
onto a Word document.  To do so you go to the Insert Menu, and click Object….  This 
displays a dialog list a number of "Insertable" controls. 

There is one problem with this dialog though; there is no browse button and no 
obvious method of adding your control to the list.  So how do you do it? 

Turns out your ActiveX control is missing one registry entry, and the Type Library 
editor does not give you the option of inserting it.  The entry is “Insertable” 
(and you’ve been wondering why I have been using that word so much).  The key goes 
in the HKEY_CLASSES_ROOT section of the registry under a key that is your ActiveX 
control’s class id. 

In the end, your registry should look something like this: 

HKEY_CLASSES_ROOT->YourControl.TheClass->Insertable 

Now, you can either go into RegEdit and enter this manually (a good way to make 
sure I’m not lying through my teeth), or you can add this entry automatically when 
the control is registered.  Ya, I thought so, option number 2 it is: 

So, if you want this to be put in the registry automatically... 

Go to the unit containing your automation object. 
Make sure Registry and Windows are in your uses statement. 
Modify your INITIALIZATION section to something like this with a new function: 

1   procedure MoreKeys;
2   const
3     C_KEY: string = 'YourControl.TheClass'; // your controls class ID
4   var
5     oReg: TRegistry;
6   begin
7     oReg := TRegistry.Create;
8   
9     try
10      oReg.OpenKey(HKEY_CLASSES_ROOT);
11  
12      // the true mean create the key if it doesn’t exist
13      oReg.OpenKey(C_Key + '\Insertable', True);
14    finally
15      oReg.CloseKey;
16      oReg.Free;
17    end;
18  
19  end;
20  
21  initialization
22    TActiveFormFactory.Create(
23      ComServer,
24      TActiveFormControl,
25      ...yada, yada, yada);
26    MoreKeys;
27  
28  end.


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC