Document.Windows Property (2007 System)
Gets a Windows collection that represents all windows for the document (for example, Sales.doc:1 and Sales.doc:2).
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)
Syntax
'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property Windows As Windows
'Usage
Dim instance As Document
Dim value As Windows
value = instance.Windows
[BrowsableAttribute(false)]
public Windows Windows { get; }
[BrowsableAttribute(false)]
public:
property Windows^ Windows {
Windows^ get ();
}
public function get Windows () : Windows
Property Value
Type: Windows
A Windows collection that represents all windows for the document.
Examples
The following code example creates two new windows for the document, and then uses the Windows property to tile all of the document windows from the top left of the screen.
This example is for a document-level customization.
Private Sub DocumentWindows()
Dim window1 As Word.Window = Me.Windows.Add()
Dim window2 As Word.Window = Me.Windows.Add()
Dim top As Integer = 10
Dim left As Integer = 10
Dim window As Word.Window
For Each window In Me.Windows
window.Top = top
window.Left = left
top += 10
left += 10
Next window
End Sub
private void DocumentWindows()
{
Word.Window window1 = this.Windows.Add(ref missing);
Word.Window window2 = this.Windows.Add(ref missing);
int top = 10;
int left = 10;
foreach (Word.Window window in this.Windows)
{
window.Top = top;
window.Left = left;
top += 10;
left += 10;
}
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.