How can I access Word 2000 from .net 2003?

  • Thread starter Thread starter Ken
  • Start date Start date
K

Ken

Hi,

I'm trying to access the values of properties -- summary and custom
without opening Word to do a cleanup op but the customer i'm doing it for
only has Office 2000. I'm using c# in .net 2003 and having trouble.

I've looked on msdn and can find a pia for Office xp but no mention of
Office 2000. Is this possible or do will I have to go back to VS6
and do it in VB?

TIA
Ken
 
This is a common misunderstanding about PIAs. The thinking is that without
a PIA, you cannot use the COM object model for a Microsoft Office app, from
a custom managed app. This is not true.

A PIA is required only when you will have multiple apps that must share
assemblies. If your app (the one that is doing cleanup) will use remoting
or some other communication to send instances of RCWs for office, to another
managed app, then you want both apps to have exactly the same definitions
for the interop assemblies. PIAs do that for you. This is especially useful
if you don't know the apps that will do the sharing - in other words,
arbitrary future clients may want to interconnect. In this case PIAs are
essential.

If on the other hand you have no communication between this cleanup app and
any other managed code, OR, if you do have communication but you "own" all
the interconnecting apps, then you do not need PIAs. You can construct
your own Interop assemblies (check out the tlbimp.exe util) and then use
those assemblies within your app, or apps. In other words, you build an
interop assembly (an IA) for Word 2000 that is not the "Primary" IA (PIA),
and just use it.

So, you can probably just invoke tlmimp on the Word 2000 TLBs, and go to
town.


-Dino
 
Back
Top