API Documentation > CorelDRAW > 2025-v26 > Document > IVGDocument
Document.Views property
Returns a collection of views for the document
Syntax:
Property Get Views() As Views
Remarks:
The Views property returns a Views collection containing all views saved in the View Manager docker.
Examples:
The following VBA example creates a new document and saves the current view as Saved View. It then creates a rectangle, zooms in on it, saves the resulting view as Full Rectangle, shows a message box, and restores the original view.
Sub Test()
Dim d As Document
Dim v As View
Dim s As Shape
Set d = CreateDocument
Set v = d.Views.AddActiveView("Saved View")
Set s = d.ActiveLayer.CreateRectangle(0, 0, 2, 2)
d.ActiveWindow.ActiveView.ToFitShape s
d.Views.AddActiveView "Full Rectangle"
MsgBox "Zoomed in at the rectangle. Press OK to restore view."
v.Activate 
End Sub