2

I need to automate MS Publisher via a Silverlight OOB application to generate a publisher document. I have done some Excel automation via Silverlight starting from an example I found on this forum. The following works

dynamic mspub = AutomationFactory.CreateObject("Publisher.Application");
dynamic pubd = mspub.Documents.Add();

However, I don't really know how I can take things further. I need to define styles, add images, add tables, add text... . I would much appreciate any help. What I lack above all is a decent reference to the various capabilities exposed by the MS Publisher automation object.

I would hugely appreciate any help.

pnuts
  • 58,317
  • 11
  • 87
  • 139
FredAt
  • 21
  • 2

1 Answers1

1

You don't specify which version you are using however MSDN is the place to find reference on for all MS API's.

Publisher 2007 Developer Reference
Publisher 2010 Developer Reference

AnthonyWJones
  • 187,081
  • 35
  • 232
  • 306
  • Thank you very much. This is exactly what I needed. Strange, I tried a search on MSDN and the two links it came up with proved to be wholly useless. I guess, I was just trying the wrong keywords. – FredAt Apr 13 '11 at 13:35
  • Hmmm... . I have looked at the documentation and it seems like its usage is not entirely painless. To help things out I worked backwards by creating a .PUB with one TextFrame and one Picture. By dint of some trial and error I found that these two objects turn up as Pages(1).Shapes(1|2). Shape(1) being my textframe I am then able to do Pages(1).Shapes(1).TextFrame.TextRange.Text = "Hello World!"; However, I have yet to figure out how to get/set the picture in the second Shape. If you can point me to some place ehre I can work through some clear example code I would be hugely grateful. – FredAt Apr 13 '11 at 13:38