Previous Document Next Document

Object Model Reference : Classes : V : Views : Properties : Views.Item


Views.Item

Property Item(IndexOrName As Variant) As View

Description

Member of Views

The Item property returns a read-only reference to a view in a Views collection. It is the default property of the Views class.

Parameter
Description
IndexOrName
Specifies the view by its index number or name:
 
Index — Specifies the preset placeholder that uniquely identifies each member of the Views collection
 
Name — Specifies the string that uniquely identifies each view

VBA example

The following VBA example displays the names of all views in the active document.

Sub Test()
 Dim intCounter As Integer
 Dim Vw As View
 Dim s As String
  For intCounter = 1 To ActiveDocument.Views.Count
   Set Vw = ActiveDocument.Views(intCounter)
   s = s & Vw.Name & vbCr
  Next intCounter
 MsgBox "The current document contains the following views: " & vbCr & s
 Set Vw = Nothing
End Sub
Sub Test()
 Dim Vw As View
 Dim s As String
  For Each Vw In ActiveDocument.Views
   s = s & Vw.Name & vbCr
  Next Vw
 MsgBox "The current document contains the following views: " & vbCr & s
 Set Vw = Nothing
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.