Monday, February 20, 2012

Working with Book Components

You might be tempted to think of FrameMaker books as containing documents. In fact, they contain book components which reference the files that when opened become FrameMaker documents.

To work with all of the documents in a book, you must traverse the list of book components and open each component in turn.

The list of book components is an ordered list. You can start with the FirstComponentInBook. Having found that component, you can use its NextComponentInBook property to find the next book component.

It is also possible to traverse a books components from last to first. In this case you start with LastComponentInBook and use the component's PrevComponentInBook property to move up the list.

The following code snippet shows how you to traverse a book's components from first to last. 

component =book.FirstComponentInBook;
while(component.ObjectValid() ){
    doSomething();
    component =  component.NextComponentInBook;
}

No comments:

Post a Comment