VERSION 2.00
Begin Form frmExport 
   BackColor       =   &H00C0C0C0&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Export Attributes"
   ClientHeight    =   1950
   ClientLeft      =   6645
   ClientTop       =   4905
   ClientWidth     =   2925
   Height          =   2355
   KeyPreview      =   -1  'True
   Left            =   6585
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1950
   ScaleWidth      =   2925
   Top             =   4560
   Width           =   3045
   Begin CommandButton cmdCancel 
      Caption         =   "&Cancel"
      Height          =   375
      Left            =   1740
      TabIndex        =   7
      Top             =   540
      Width           =   1095
   End
   Begin CommandButton cmdOK 
      Caption         =   "&OK"
      Default         =   -1  'True
      Height          =   375
      Left            =   1740
      TabIndex        =   6
      Top             =   120
      Width           =   1095
   End
   Begin Frame Frame2 
      BackColor       =   &H00C0C0C0&
      Caption         =   "Output To"
      Height          =   855
      Left            =   60
      TabIndex        =   3
      Top             =   1020
      Width           =   1575
      Begin OptionButton radWhere 
         BackColor       =   &H00C0C0C0&
         Caption         =   "&File"
         Height          =   255
         Index           =   2
         Left            =   120
         TabIndex        =   5
         Top             =   540
         Width           =   1035
      End
      Begin OptionButton radWhere 
         BackColor       =   &H00C0C0C0&
         Caption         =   "Clip&board"
         Height          =   255
         Index           =   1
         Left            =   120
         TabIndex        =   4
         Top             =   240
         Value           =   -1  'True
         Width           =   1335
      End
   End
   Begin Frame Frame1 
      BackColor       =   &H00C0C0C0&
      Caption         =   "Shapes"
      Height          =   855
      Left            =   60
      TabIndex        =   0
      Top             =   60
      Width           =   1575
      Begin OptionButton radWhat 
         BackColor       =   &H00C0C0C0&
         Caption         =   "&Selection"
         Height          =   255
         Index           =   2
         Left            =   180
         TabIndex        =   2
         Top             =   540
         Width           =   1275
      End
      Begin OptionButton radWhat 
         BackColor       =   &H00C0C0C0&
         Caption         =   "&All"
         Height          =   255
         Index           =   1
         Left            =   180
         TabIndex        =   1
         Top             =   240
         Value           =   -1  'True
         Width           =   1275
      End
   End
End
Option Explicit

Sub cmdCancel_Click ()
    g_iWhere = OUT_INVAL
    g_iExportType = EXPTYPE_INVAL

    Unload frmExport
End Sub

Sub cmdOK_Click ()
    Unload frmExport
End Sub

Sub Form_KeyPress (KeyAscii As Integer)
    If 27 = KeyAscii Then cmdCancel_Click
End Sub

Sub Form_Load ()
    ' Set ourselves on-top

    SetWindowPos frmExport.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_NOSIZE Or SWP_NOMOVE
    
    ' Set our default radio buttons

    radWhere_Click OUT_CLIPBOARD
    radWhat_Click EXPTYPE_ALL

    ' Center the form

    Left = (Screen.Width / 2) - (Width / 2)
    Top = (Screen.Height / 2) - (Height / 2)

    ' First we make sure Visio is in an exportable state

    If vaoGetVisio(True, False) <> visGet Then
        MsgBox "Visio must be loaded.", MB_ICONSTOP, "Error"
        Unload frmExport
    ElseIf g_appVisio.ActiveWindow.Page.Shapes.Count = 0 Then
        MsgBox "No shapes on active page.", MB_ICONSTOP, "Error"
        Unload frmExport
    End If
End Sub

Sub radWhat_Click (Index As Integer)
    ' When the user wants to export a selection, we only let them
    ' if Visio has some shapes selected.

    If Index = EXPTYPE_SELECTION Then
        If g_appVisio.ActiveWindow.Selection.Count = 0 Then
            MsgBox "No shapes selected", MB_ICONSTOP, "Error"
            radWhat(EXPTYPE_ALL).SetFocus
            Exit Sub
        End If
    End If

    g_iExportType = Index
End Sub

Sub radWhere_Click (Index As Integer)
    g_iWhere = Index
End Sub

