Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
other
informationbridge
office.intranets
office.misc
office.setup
office.xml
officeupdate
onenote
photodraw.discussion
powerpoint
producer
proj.standard&server
project
project.developer
project.pro_and_serve
project.server
project.vba
project2000
publisher
publisher.prepress
publisher.programming
publisher.webdesign
visio
visio.createshapes
visio.database.modeling
visio.dev.diagrams
visio.dev.shapesheet
visio.dev.vba
visio.dev.vc
visio.developer
visio.general
visio.installation
visio.printing
visio.software.modeling
visio.troubleshoot
  
 
date: Tue, 1 Jul 2008 15:01:01 -0700,    group: microsoft.public.publisher.programming        back       


Publisher Newbie - Object Model In .NET   
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!

Any info will be greatly appreciated.

Thanks
smiller
date: Tue, 1 Jul 2008 15:01:01 -0700   author:   smiller

Re: Publisher Newbie - Object Model In .NET   
smiller wrote:
> 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.

-- 
Ed Bennett - MVP Microsoft Publisher
http://ed.mvps.org
date: Wed, 02 Jul 2008 00:48:57 +0100   author:   Ed Bennett

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us