Description

Returns list of open instances of data windows as collection of integers

Return Type

A Collection object.  

Collection of instances as integers

Syntax

object.GetListOfDataWindows (WindowName)

The GetListOfDataWindows Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McDataViewer.
WindowNameRequired. A String value.

name of the window, can be “DataTable”, “DataHistogram”, “DataGraph” or “ScatterPlot”

Remarks

The list of instances can be used to access opened data windows as in the following example:

    Sub CopyAllDataGraphsToMsWord()
       Dim InstColl As Collection, i As Integer, j As Integer
       'get MsWord
       Dim msWord As Word.Application
       Set msWord = CreateObject("Word.Application")
       If Not msWord Is Nothing Then
             With msWord
                 .Visible = True
                 .Documents.Add DocumentType:=wdNewBlankDocument
             End With
        End If

        Dim DataWindows
        DataWindows = Array("DataHistogram", “DataGraph”, “ScatterPlot”)
        For j = 0 To UBound(DataWindows)
            Set InstColl = Application.DataViewer.GetListOfDataWindows(DataWindows(j))
            'copy graphs of all open data windows to MsWord
            For i = 1 To InstColl.Count
               'copy graph to clipboard
               Application.Dialogs(DataWindows(j), InstColl(i)).ActivePage.Control.CopyGraphToClipboard
               'paste graph to open word document
               If Not msWord Is Nothing Then
                    With msWord
                        .Selection.Paste
                        .Selection.TypeParagraph
                    End With
                End If
           Next i
       Next j
    End Sub