smiller said:
This might be an idiotic question, but, can I somehow manipulate the
Publisher Object Hierarchy from within a .NET application? If so, could
someone point me in the right direction, (or somwhere thereabouts). If
not....well...just let me down eazy..heh!
Hi,
The Publisher OM is well-accessible from .NET; I've done so myself for a
few add-ins and utilities.
You need to have the .NET framework installed when you install Office
for the PIAs for Office to be installed. These are necessary in order
for the .NET runtime to interact with Publisher's COM interface.
Once that's there, you need to set references to the Microsoft Publisher
Object Library and the Office Object Library.
Once those are in place, you can reference the Publisher object library
from .NET code using Microsoft.Office.Interop.Publisher (where in VBC
code you would simply use Publisher) and Microsoft.Office.Core (where in
VBC code you would use Office). In both cases in VBA code you would not
use a qualifier at all. For example, the VBA code:
Dim aDoc As Document
or the VBC code
Dim aDoc As Publisher.Document
now becomes
Dim aDoc As Microsoft.Office.Interop.Publisher.Document
in VB.NET. (If you use C#/J#/Managed C++/whatever#, you're on your own!)
Note that the PIAs for Publisher are not always well-typed; you will end
up having to use CType in order to avoid compiler warnings.