ParallelGraphics
Home  »  Developer Zone  »  Products  »  VrmlPad  »  References  »  Documents
Up to References

Document 

Documents 

Entity 

Field 

Fields 

MFValue 

Node 

Nodes 

Proto 

Protos 

Range 

Route 

Routes 

SFColor 

SFRotation 

SFVec2f 

SFVec3f 

VrmlMatrix 

Window 


Subscribe to Newsletter
 


Google Searchsite search:

 

%(domain)s %(domain)s
Install Cortona VRML Client!

Outline 3D


Documents

Documents Object

 
Active

 
Count

 
Open

 
_NewEnum

 
Close

 
Item

 
SaveAll

See also:
Using collections.
 
Active property, read/write, Object.

Sets or returns a Document object that represents an active (visible) document of the collection.

The following VBScript macro selects a next document in the document bar.

Set docs = Window.Documents
For i = 1 To docs.Count
  If docs(i) Is docs.Active Then
    If i = docs.Count Then i = 0
    docs.Active = docs(i + 1)
    Exit For
  End If
Next




 
Close method ( [IndexOrName], [SaveChanges] ).

Closes the specified document and removes it from the collection.

IndexOrName (Optional)
The name or index number of a member of the collection. The index can be a numeric expression (a number from 1 to the value of the collection's Count property), a constant, or a string, that represents the pathname of a document from the collection.
If the value provided as IndexOrName doesn't match any existing member of the collection, an error occurs.

By default (if IndexOrName is not specified), the methog closes all documents in the collection.

SaveChanges (Optional)
An enum of type VpSaveOptions that indicates whether to save changes to a document before closing it. Following are the possible values, which have the Long type:

  • vpPromptToSaveChanges = 0 (the default)
    Prompts the user to save changes. If the user cancels the SaveAs dialog, Close method fails.
  • vpDoNotSaveChanges = 1
    Does not save changes, and does not prompt the user.
  • vpSaveChanges = 2
    Saves all changes and does not prompt the user.



 
Count property, read-only, Long.

Returns the number of items in the specified collection.




 
Item property, default, read-only, ( IndexOrName ) As Object.

Returns a Document object that represents a member of the collection, either by position or by name.

IndexOrName
The name or index number of a member of the collection. The index can be a numeric expression (a number from 1 to the value of the collection's Count property), a constant, or a string, that represents the pathname or the title of a document from the collection.
If the value provided as IndexOrName doesn't match any existing member of the collection, an error occurs.




 
Open method ( [URL] ) As Object.

Adds a new document to the specified Documents collection or activates an existing document. Returns the Document object, that represents a new document.

URL (Optional)
A String that specifies the URL or the full path to the existing VRML file. If a document with the specified URL already opened, the method activates this document and returns a new reference to it.
By default, the Open method adds a new empty document to the collection.




 
SaveAll method ( [PromptUser] ).

Saves all open documents in the collection.

PromptUser (Optional)
A Boolean indicating whether to prompt the user to save changes. Possible values are:
True - Prompts the user to save the changes to each open document.
False - Does not prompt the user (the default).




 
_NewEnum property, read-only.

References documents in the specified collection.

With C++, you can browse a collection to find a particular item by using the _NewEnum or the Item properties. In Visual Basic and VBScript, you do not need to use the _NewEnum property, because it is automatically used in the implementation of For Each ... Next or in For ... in statement in JavaScript.

The following example in Visual Basic prints all opened document filenames to the Immediate pane.

Dim doc As Document
For Each doc In Document.Window.Documents
  Debug.Print doc.FileName
Next doc





Last updated: Fri, 21 Nov 2008
© 2000-2008 ParallelGraphics. All rights reserved. Terms of use.