Add method (Windows collection)

Microsoft Visio Developer Reference

Add method (Windows collection)

   Example   

Adds a new Window object to the Windows collection.

Version added

2000

Syntax

objRet = object.Add ([varCaption][, varFlags]
[, varType][, varLeft][, varTop][, varWidth]
[, varHeight][, bstrMergeID][, bstrMergeClass]
[, nMergePostition])

objRet

The new Window object added to the collection.

object

Required. An expression that returns a Windows collection.

varCaption

Optional Variant. The title of window; default is "Untitled".

varFlags

Optional Variant. Initial window state. Can contain any combination of visWindowStates constants declared in the Visio type library; default varies based on the varType.

varType

Optional Variant. Type of new window. Defaults to visStencilAddon for Application.Windows; defaults to visAnchorBarAddon for Window.Windows.

varLeft

Optional Variant. Position of the left side of the window.

varTop

Optional Variant. Position of the top of the window.

varWidth

Optional Variant. Width of the client area of the window.

varHeight

Optional Variant. Height of the client area of the window.

bstrMergeID

Optional Variant. Merge ID of the window.

bstrMergeClass

Optional Variant. Merge class of the window.

nMergePostition

Optional Variant. Merge position of the window.

Remarks

Use this method to get an empty parent frame window within the Visio window space that you can populate with child windows. You must be in the Visio process space (for example, in a DLL/VSL based add-on) to use the Window object returned by this method as a parent to your windows.

Use the value returned by the WindowHandle32 property as an HWND for use as a parent to your own windows.