Applying master pages after file open
I am opening XML files which may have large tables that force the page layout to landscape. But as the table location is just the anchor and not the entire table contents, only the first page on which the table occurs is getting the landscape format. When I apply the master pages via the menu, this problem is corrected. So I tried to call that function after opening the file, but there is no effect. Does anyone have experience with calling the ApplyMasterPages function from a script when opening the file ?
Here is the event handler code that fires when opening an XML file. The ProcessTables( ) function takes several layout attributes and applies them to the table properties, so applying master pages has to be done after that, as the layout changes may affect the number of pages spanned by the table.
ProcessTables( oDoc );
var oCmd = app.GetNamedCommand( "ApplyMasterPages" );
Fcodes( [oCmd.Fcode] );
This does not do a thing on the opened document. But when I take the last two lines and put them in a new script and execute that, the result is what I need it to be. So why is the code not firing when I call it in my event handler ? Any ideas ?
4everJang
