The Portfolio VB Type Library's Object Model


<< Using VBS with Portfolio ...
Back to Portfolio FAQ index
Portfolio VB Type Library ... >>

This is not in any official documentation. The information below has been derived using the PDF supplied with the scripting extras and by study of the Portfolio Type Library TLB) in Visual Basic's Object Browser. There basic object hierarchy is shown in the this diagram:

Note that the name of the top level Object varies depending on whether you are using the v4 Portfolio.TLB (Portfolio.Document), the v5.x Portfolio5.TLB (Portfolio_V5.Document) or the v6.x Portfolio6.TLB (Portfolio_V6.Document). Version 5 installs both v4 and v5 TLBs giving you backwards compatibility; v6 just installs the v6 TLB. There are only minor differences which are described for v7.0, v6.02/v6.03, v6.0/v6.01 and v4/v5. For a more detailed VB TLB object hierarchy see this diagram (opens new window), or the v7 model.

The usage derived from the above is not quite as you might expect. This second diagram gives a better picture:

The most important point to notice is the absence of the Catalog object. Within the automation model, the 'document' object is a collection of Gallery objects. To check the Catalog name you have to call the CatalogName property of the Gallery. Indeed, Gallery names include the Catalog name, e.g. "MyCatalogue.FDB - My Saved Gallery" where "My Saved Gallery is the names entered in the Name text box when the Gallery was first saved.

Galleries, Records and Fields are all effectively accessed by their index number within a collection, as in this pseudocode:

gallery(i).records(i).field("fieldname").Value

Getting the Gallery index number is complicated by the fact that the index is dynamic - you have to find the index number from the name using the GetGalleryIndexFromName function. If the Gallery you want to access is the active one, no problem. Otherwise you must use SetActive or enumerate all the Galleries and check for a name match before you can find the index. Easy!

If your desired Gallery is not open you are sunk. There is currently no way to open an existing, but closed, Gallery in an open Catalog. Oops! Hopefully this 'feature' will get fixed soon, given that pre-saved & customised Galleries are central to Portfolio's concept. Although you could do a Find operation with criteria you know will give a correct recordset, visual customisation of the Gallery cannot be done programmatically. Neither can you set the view type (record, list or thumbnail).



Question: The Portfolio VB Type Library's Object Model [FAQ00125.htm]
Last Update:- 01 June 2006


<< Using VBS with Portfolio ...
Back to Portfolio FAQ index
Portfolio VB Type Library ... >>

Quick Search of PortfolioFAQ (word, words or phase): or try the Advanced Search

User-to-User Forums  |  Report error/typo/broken link  |  Request new topic  |  Ask a question

Site and articles © Mark Anderson 2001-2007 - Visit my home page


This FAQ is created and maintained using
Friday logo
Friday - The Automatic FAQ Maker