Object Model Reference : Classes : V : Views : Properties : Views.Item |
Property Item(IndexOrName As Variant) As View
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.
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 |
Copyright 2013 Corel Corporation. All rights reserved.