In InDesign, one "places" Word documents, rather than open. So try using the place() method of an insertionPoint (or any Text object):
InsertionPoint.place (fileName: File , showingOptions: Boolean , withProperties: Object ):Array of varies
Adobe InDesign CC 2015 (11.0) Object Model
Places the file.
fileName: Data Type: File
The file to place
showingOptions (optional): Data Type: Boolean , Default Value: false
Whether to display the import options dialog (Optional)
withProperties: Data Type: Object
Initial values for properties of the placed object(s) (Optional)
Thanks a lot for a detailed answer.
I just would like to specify a couple items:
-Does it means that I can place the word document into .indd file and print it as a pdf, for example?
-Should I perform some additional processing of placed word document to place it into .indd?
-Otherwize could you please appoint the sequence of basic steps to implement word->indd convertion?
You can indeed place a Word document into an InDesign file and print it as a PDF. But when the Word document comes into InDesign, expect a lot of work tidying up the formatting, redesigning, and preparing the file for the correct sort of PDF (digital or print) that is required. This is a big job usually (unless you're lucky with your Word file, or it's very simple, or you really don't care what it looks like much) -- and many people have full-time jobs, if not careers, doing just that all day :-)
"-Should I perform some additional processing of placed word document to place it into .indd?"
Are you talking about from a scripting perspective? From a scripting perspective, you do not have to do anything special to a Word file to be able to place it into InDesign. (But from a practical point of view, people usually do prepare Word files before placing, to make it easy to work with them afterwords in InDesign.)
"-Otherwize could you please appoint the sequence of basic steps to implement word->indd convertion?"
InDesign, place your text cursor in a text frame somewhere. Then run this one-line script:
That's the basics.
PS It sounds to me like you need to get a little more familiar with using InDesign. For scripting, it's always good to know first how to do something in InDesign with the regular UI before trying to script it, because scripting really basically just replicates the steps you would be doing manually as a user.
I've made the doc placing in the regular UI.
It seems it requiers manual page-by-page frames filling.
The place() method itself has an autoflow flag that should lead to some kind of autoadding/autofilling frames.
At the first glance It could be queit simple in case if we can get word document page amount before the placing.
The another common way is spreading the content of doc with cycling with text frames adding and overflow checking.
alexanderk57613459 wrote:… The place() method itself has an autoflow flag that should lead to some kind of autoadding/autofilling frames. …
now reading that thread here, that is related to the other one you started, I could see a potential problem with your thinking.
Generally spoken, method place() itself has no autoflow flag. Only when it's used with the Page object.
See my reply here: