How do I build Word 2000 PIAs?

D

David Thielen

Hi;

As best as I can tell, the way to build the PIAs is either:

TlbImp Widget.tlb /primary /keyfile:AcmeKey.snk /out:WidgetLib.dll

- or -

import the COM dlls and have Visual Studio create the PIAs.

So my question is:

1. For the tlbimp approach - I can't find any .tlb files in the Office 2000
install.

2. For the import COM dlls - what dlls are (is?) that for Word 2000?
 
G

Gary Chang[MSFT]

Hi Dave,

Currently I am looking for somebody who could help you on it. We will reply
here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.


Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
F

Fredrik Wahlgren

Hiu

I just want to mention that I'm interested in this topic too. I have read
many of your replies and I think you do a great job.

/ Fredrik
 
D

David Thielen

Hi again;

When you get the answer to this - please, please, please make sure it will
use the same namespaces as the Word 2002/2003 PIAs.

thanks - dave
 
P

Peter Huang

Hi

The word 9.0's type library is MSWORD9.OLB, we can find that in the path
below.
c:\Program Files\Microsoft Office\Office\MSWORD9.OLB

In VS,NET COM reference, we can try to find the microsoft word 9.0 library
in the list box under COM Reference.

When we generate the PIA with tlbimp, we can use the /namespace to
determine the PIA's namespace.
/namespace:Namespace Namespace of the assembly to be produced

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
D

David Thielen

Hi;

That got me the Word interop. But it then referenced the version 11.x
interops in the GAC for office and vbe. Where do I get those? (I looked in
the office directories but couldn't find a .olb file for office or vbe.)

thanks - dave
 
D

David Thielen

Hello;

I tried using tlbimp (to get the correct namespaces). When I ran it I got
this:

C:\src\AutoTag\AutoTag2000\libs>tlbimp "o:\Program Files\Microsoft
Office\Office
\MSWORD9.OLB" /out:Word.dll /namespace:Microsoft.Office.Interop
/keyfile:..\..\l
ib\keypair.snk /primary
Microsoft (R) .NET Framework Type Library to Assembly Converter 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

TlbImp error: System.ApplicationException - Referenced type library 'Office'
doe
s not have a primary interop assembly registered.

C:\src\AutoTag\AutoTag2000\libs>

I am guessing it needs a /reference:Office.dll pointing to the office PIA
for Office 9.x. Is that the issue or does it need something else? And if it
needs references to both office and vbe - haw do you set /reference: to point
to 2 files - do you have the option twice?

And shouldn't tlbimp work anyways as office.dll is in the GAC (the version
10 and 11 ones)? That should provide the reference to office. Or am I missing
something?

thanks - dave
 
D

David Thielen

Hi;

I was able to build it using the following:

C:\src\AutoTag\AutoTag2000\libs>tlbimp "o:\Program Files\Microsoft
Office\Office
\MSWORD9.OLB" /out:Word.dll /namespace:Microsoft.Office.Interop.Word
/keyfile:..
\..\lib\keypair.snk /primary
/reference:C:\WINNT\assembly\GAC\Office\11.0.0.0__7
1e9bce111e9429c\Office.dll
Microsoft (R) .NET Framework Type Library to Assembly Converter 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

Type library imported to C:\src\AutoTag\AutoTag2000\libs\Word.dll

C:\src\AutoTag\AutoTag2000\libs>

Obviously I can't use the ver 11.x Office.dll but it shows that what I need
is the office and vbe PIAs.

I also added this PIA as a reference and now my only undefindes in building
the project are the office & vbe references - the word ones are all there.

thanks - dave
 
D

David Thielen

Hello;

Googling on MSWORD9.OLB got it for me. Here is an article that explains it:
http://www.codeguru.com/Cpp/COM-Tech/atl/tutorials/article.php/c3591/

And here are my three builds:

C:\src\AutoTag\AutoTag2000\libs>tlbimp "o:\Program Files\Microsoft
Office\Office
\MSO9.DLL" /out:Office2000.dll /namespace:Microsoft.Office.Core
/keyfile:..\..\l
ib\keypair.snk /primary
Microsoft (R) .NET Framework Type Library to Assembly Converter 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

Type library imported to C:\src\AutoTag\AutoTag2000\libs\Office2000.dll

C:\src\AutoTag\AutoTag2000\libs>tlbimp "o:\Program Files\Common
Files\Microsoft
Shared\VBA\VBA6\VBE6EXT.OLB" /namespace:Microsoft.Vbe.Interop
/keyfile:..\..\lib
\keypair.snk /out:Vbe6.dll
Microsoft (R) .NET Framework Type Library to Assembly Converter 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

TlbImp warning: Primary interop assembly 'Microsoft.Vbe.Interop,
Version=11.0.0.
0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' is already registered
for t
ype library 'o:\Program Files\Common Files\Microsoft
Shared\VBA\VBA6\VBE6EXT.OLB
'.
Type library imported to C:\src\AutoTag\AutoTag2000\libs\Vbe6.dll

C:\src\AutoTag\AutoTag2000\libs>tlbimp "o:\Program Files\Microsoft
Office\Office
\MSWORD9.OLB" /out:Word2000.dll /namespace:Microsoft.Office.Interop.Word
/keyfil
e:..\..\lib\keypair.snk /primary /reference:Office2000.dll
Microsoft (R) .NET Framework Type Library to Assembly Converter 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

Type library imported to C:\src\AutoTag\AutoTag2000\libs\Word2000.dll

C:\src\AutoTag\AutoTag2000\libs>

I am assuming the warning when building the VBE dll is ok???

thanks - dave
 
P

Peter Huang

Hi

Yes the warning is because that when the tlbimp try to add the according
registry key, it find that the office 11 has registered there.
Also I think it would better to generate the office 2000 PIA in a
standalone environment without other office version installed in case of
the cross reference error.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang [MSFT]

Hi

Thank you for sharing your experience in the community.


Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top