The following VBA example checks for views in the
Views collection. If there is a view, it prints the horizontal origin of the view. If not, it adds a view and prints the horizontal origin.
Sub Test()
Dim Vw As View
Dim VwCollection As Views
Set VwCollection = ActiveDocument.Views
If VwCollection.Count > 0 Then
Set Vw = VwCollection.Item(1)
MsgBox "The horizontal origin of the active view is: " & Vw.OriginX
Else
Set Vw = VwCollection.AddActiveView("TestView")
MsgBox "The horizontal origin of the active view is: " & Vw.OriginX
End If
Set Vw = Nothing
Set VwCollection = Nothing
End Sub