18.01.2013 Views

LotusScript for Visual Basic Programmers - IBM Redbooks

LotusScript for Visual Basic Programmers - IBM Redbooks

LotusScript for Visual Basic Programmers - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

We declare a session, db and view which reference the NotesView object.<br />

Dim session As Object<br />

Dim db As Object<br />

Dim view As Object<br />

We get the reference to NotesView using the GetView method of<br />

NotesDatabase.<br />

Set view = db.GetView("By Author")<br />

We print out the Name of the view.<br />

Print (view.Name)<br />

Locating a View<br />

If the name of the view or folder is known, specify it to the GetView<br />

method of NotesDatabase. The view or folder name must be specified<br />

exactly, including cascades; <strong>for</strong> example, Certificates and ID<br />

In<strong>for</strong>mation\Cross Certificates. If the name has a synonym, you can specify<br />

the name or the synonym. For example, if a view name is By Author and<br />

the synonym is AuthorView, you can specify it as<br />

“By Author”<br />

or<br />

“AuthorView”<br />

However, you cannot specify both the name and the alias using the OR<br />

operator. For example, By Author | AuthorView is not possible.<br />

If the name of the view or folder is not known, you can compare each view<br />

and folder in the Views property of NotesDatabase with one of the<br />

NotesView properties; <strong>for</strong> example, IsDefaultView or UniversalID.<br />

For more details, refer to the previous example.<br />

Deleting a View<br />

If you update a database by adding, deleting, or changing in<strong>for</strong>mation, the<br />

updates are not reflected in a view or folder until they are refreshed. The<br />

user can refresh a view or folder by clicking the refresh button or choosing<br />

View - Refresh.<br />

If you want updates to automatically appear in a view or folder, call the<br />

Refresh method of NotesView after the update is complete. Document<br />

updates must first be posted to storage using the Save method of<br />

NotesDocument.<br />

If you want to remove a view or a folder, call the Remove method.<br />

140 <strong>LotusScript</strong> <strong>for</strong> <strong>Visual</strong> <strong>Basic</strong> <strong>Programmers</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!