LispWorks COM/Automation User Guide and Reference Manual > 3 Using Automation > 3.3 Calling Automation methods

NextPrevUpTopContentsIndex

3.3.4 Using collections

The macro do-collection-items can be used to iterate over the items or an interface that implements the Collection protocol. If the collection items are interface pointers, they must be released when not needed.

For example, to iterate over the Table objects from the Tables collection of a MyDocument interface pointer

(with-temp-interface (tables)
    (call-dispatch-get-property
       (doc my-document tables))
  (do-collection-items (table tables)
    (inspect-the-table table)
    (release table)))

LispWorks COM/Automation User Guide and Reference Manual - 22 Dec 2009

NextPrevUpTopContentsIndex