pub2007 - modify PageSetup.MultiplePagesPerSheet programmatically

B

bcarsto

During the corse of automating publisher2007 in vs2008 with C#, I need to
modify the PageSetup properties, particularly MultiplePagesPerSheet . I use
the following code to do this
// create application
Microsoft.Office.Interop.Publisher.Application a = new
Microsoft.Office.Interop.Publisher.Application();

// open document
Microsoft.Office.Interop.Publisher.Document d =
a.Open(@"C:\projects\future\publisher2007\publisher2007\3x5_example.pub",
false, false, PbSaveOptions.pbDoNotSaveChanges);

// read then modify property
bool m = d.PageSetup.MultiplePagesPerSheet;
d.PageSetup.MultiplePagesPerSheet = m;

This last like causes an exception {"Exception from HRESULT: 0x8004005A"}
with publisher 2007 and works fine with publisher 2003

I can provide sample PB file and c# project.thanks

bob
 
Top