-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomboMsgBox.frm
More file actions
78 lines (66 loc) · 2.15 KB
/
Copy pathcomboMsgBox.frm
File metadata and controls
78 lines (66 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
VERSION 5.00
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} comboMsgBox
Caption = "Select existing table"
ClientHeight = 3765
ClientLeft = 120
ClientTop = 465
ClientWidth = 6585
OleObjectBlob = "comboMsgBox.frx":0000
StartUpPosition = 1 'CenterOwner
End
Attribute VB_Name = "comboMsgBox"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public parsedDoc As Document
Public nDocTables As Integer
Public Sub UserForm_Initialize()
Dim i As Integer
Dim firstColumn() As String
Dim secondColumn() As String
Set parsedDoc = Module1.doc
nDocTables = Me.parsedDoc.Tables.Count
ReDim Preserve firstColumn(1 To nDocTables)
ReDim Preserve secondColumn(1 To nDocTables)
'
For i = 1 To nDocTables
firstColumn(i) = refNumForm.RemoveNonPrintChars(Me.parsedDoc.Tables(i).Cell(1, 1).Range.Text)
If Me.parsedDoc.Tables(i).Columns.Count > 1 Then
secondColumn(i) = refNumForm.RemoveNonPrintChars(Me.parsedDoc.Tables(i).Cell(1, 2).Range.Text)
Else
secondColumn(i) = "[EMPTY CELL]"
End If
Next i
cbFirst.List = firstColumn
cbSecond.List = secondColumn
' Set some initial values for the very first table in the document
tbIndex.Text = "1"
cbFirst.ListIndex = 0
cbSecond.ListIndex = 0
End Sub
Public Sub cbFirst_Change()
' Update the value in cbSecond
cbSecond.ListIndex = cbFirst.ListIndex
' Update the value in tbIndex
tbIndex.Text = cbFirst.ListIndex + 1
End Sub
Public Sub cbSecond_Change()
' Update the value in cbFirst
cbFirst.ListIndex = cbSecond.ListIndex
' Update the value in tbIndex
tbIndex.Text = cbSecond.ListIndex + 1
End Sub
Public Sub butChoose_Click()
' Update the global variables and proceed to run the main loop in the refNumForm
existingFlag = True
choosenTable = cbFirst.ListIndex + 1
' Quit this form
Unload Me
End Sub
Public Sub butQuit_Click()
' Close this userform
existingFlag = False
Unload Me ' Close this userform
End Sub