3.34 Documents

A collection of Document objects contained in a document library.

3.34.1 Properties

The following table lists properties along with their access and descriptions.

Property

Access

Description

Application

R/O

Application. The Application object.

_NewEnum

R/O

Enumeration object. Implements IEnumVARIANT.For Windows only. 

Parent

R/O

DocumentLibrary. The DocumentLibrary object that owns this collection. 

3.34.2 Methods

Document Add(String Filename, [VARIANT DocumentType])

Creates a new document and adds it to the collection. It does not directly support the creation of a new document using a template document. To locate a template document, call the DocumentVersion object's CopyOut method, then use the resulting file with the current Add method.

Filename is the file from which the document is created.

DocumentType specifies the new documents DocumentType. If DocumentType is a String, it specifies the DocumentType object’s name. If DocumentType is an existing DocumentType object, the new document will be of that DocumentType.

When you add a document in GroupWise Remote, the new document is assigned a temporary document and Open Document Management API (ODMA) identifier. When the remote account is synchronized with the master account, the ID will change. DocumentReference objects that refer to the temporary ID will be modified. Using a DocumentReference, an Independent Software Vendor (ISV) can track the document through a synchronization cycle.

If you pass a string as the DocumentType parameter, the string must be a valid document type. To figure out the set of valid document types, use Object API and ask for the DocumentTypes from a DocumentLibrary object. You can then iterate through this collection to find the list of valid DocumentTypes.

If a user must enter a Document Type to a third-party application, fill in a combo box, list box, or other window control with the DocumentType Names from that DocumentTypes collection. Use the Windows control selection as the Document Type parameter to the Documents::Add method.

In addition, you may add a document in GroupWise Remote, but you may not have rights on the master system to add the document there. If this is the case, the document will exist in your local copy of the document library, but it will not be added to the master system. In this case, failure to upload a new document will not delete the document from the local (remote) library. This condition cannot be detected through the Object API for GroupWise.

Document AddEx(String Filename, [VARIANT DocType], [VARIANT DocRefFolder])

Creates a new document and adds it to the collection. The first two parameters are the same as the parameters for the Add method. DocRefFolder, if supplied, must be a Folder object. It represents the folder in which you wish to add a document reference to the document you are adding to the collection.

DocumentIterator CreateDocumentIterator()

Creates a new DocumentIterator object for iterating over the Documents in this collection.

3.34.3 Remarks

Because a Documents collection can contain several thousand documents, the collection is designated a "large collection." This means that it does not support a Count property or an Item method. Instead, it provides access to its elements through an iterator object. In addition, the Documents collection parent (DocumentLibrary) provides the NextDocumentNumber property and the GetDocument method to allow access to documents by document number. GetDocument, however, throws an exception for document numbers less than NextDocumentNumber because the document may have been deleted (document numbers are not reused) or the user may not have access rights to the document.

A Documents collection is refreshed when its parent object is refreshed. When a Documents collection is refreshed, it updates the documents in the collection but does not recursively refresh the Document objects themselves.