Important alert: (current site time 7/16/2013 5:38:16 AM EDT)
 

article

A problem with with type library code for MS Word interfacing

Email
Submitted on: 7/10/2006 3:49:55 PM
By: Giorgio Castellani  
Level: Advanced
User Rating: Unrated
Compatibility: Delphi 7, Delphi 6, Delphi 5, Delphi 4, Pre Delphi 4
Views: 9890
author picture
 
     A solution of a problem with automatically generated type library code from MSWORD.OLB to interface with MS Word.

 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
  1. You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
				When I generated the type library module from the files MSWORD.OLB for MS Word 11 and the new version 12 I got the following code:
procedure TWordApplication.InitServerData;
const
 CServerData: TServerData = (
ClassID:'{000209FF-0000-0000-C000-000000000046}';
IntfIID:'{00020970-0000-0000-C000-000000000046}';
EventIID: '{00020A01-0000-0000-C000-000000000046}';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;
and
procedure TWordDocument.InitServerData;
const
 CServerData: TServerData = (
ClassID:'{00020906-0000-0000-C000-000000000046}';
IntfIID:'{0002096B-0000-0000-C000-000000000046}';
EventIID: '{00020A02-0000-0000-C000-000000000046}';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData
end;
which I have found don't works with MS Word 10 and 12
changing them on:
procedure TWordApplication.InitServerData;
const
 CServerDataNew: TServerData = (
ClassID:'{000209FF-0000-0000-C000-000000000046}';
IntfIID:'{00020970-0000-0000-C000-000000000046}';
EventIID: '{000209F7-0000-0000-C000-000000000046}';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerDataNew;
end;
and
procedure TWordDocument.InitServerData;
const
 CServerDataNew: TServerData = (
ClassID:'{00020906-0000-0000-C000-000000000046}';
IntfIID:'{0002096B-0000-0000-C000-000000000046}';
EventIID: '{000209F6-0000-0000-C000-000000000046}';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerDataNew
end;
make it working with all MS Word versions from 8 to 12.


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Advanced category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
2/2/2007 9:14:00 PMjalal

pls
(If this comment was disrespectful, please report it.)

 
3/6/2009 8:03:34 AMtumuruu

hi all
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.