I am trying to place an excel file to a textframe set in masterpage.
The first digit of the placePoint value array doesn't affect the position of the text frame. If I set the number too high, the script throws an error stating "This value would cause one or more objects to leave the pasterboard". The second affects the y-coordinate as expected.
1 doc = app.open(filePath = "d:/base.indt");
2 excelFile = new File ("d:/source.xlsx");
3 docStoryList = doc.pages.place (excelFile, [2, 7], undefined, false, true);
4 docStory = docStoryList;
Many thanks in advance!
I founded help here:
Instead placing the Excel file to a page, it should be placed to a text frame. There must be only one textframe in the masterpage for this to work.
1 doc = app.open(filePath = "d:/Base.indt");
2 doc.textPreferences.smartTextReflow = true;
3 masterTextFrame = doc.pages.appliedMaster.textFrames.override(doc.pages);
4 excelFile = new File ("d:/Source.xlsx");
5 docStory = masterTextFrame.place (excelFile);
Still thinking how the placePoint is supposed to be used. Would be nice if someone pointed the error in my code.