-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathFPJurors
150 lines (137 loc) · 5.69 KB
/
FPJurors
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
Function FPJurors()
'============================================================================
' Name : FPJurors
' Author : Erica L Ingram
' Copyright : 2019, A Quo Co.
' Call command: Call FPJurors()
' Description : does find/replacements of prospective jurors in transcript
'============================================================================
Dim sRoughDraft As String, sFileName As String, sSpeakerName As String
Dim sCourtCover As String, ssSpeakerFind As String, sdSpeakerFind As String
Dim sqSpeakerFind As String, ssSpeakerName As String, sdSpeakerName As String
Dim sqSpeakerName As String, sCourtDatesID As String
Dim oCourtCoverWD As Object, oWordApp As Object
Dim x As Integer, y As Integer
Call GetCaseInfoQDFRecordset 'refresh transcript info
sCourtDatesID = Forms![NewMainMenu]![ProcessJobSubformNMM].Form![JobNumberField]
x = 101 '101 is number of first PROSPECTIVE JUROR
sCourtCover = "T:\In Progress\" & sCourtDatesID & "\" & sCourtDatesID & "-CourtCover.docx" 'file name to do find replaces in
Set oWordApp = CreateObject("Word.Application")
oWordApp.Visible = False
Set oCourtCoverWD = oWordApp.Documents.Open(sCourtCover)
With oCourtCoverWD
ssSpeakerFind = " snl100 "
sdSpeakerFind = " dnl100 "
sqSpeakerFind = " qnl100 "
ssSpeakerName = ".^p" & UCase("PROSPECTIVE JUROR") & ": "
sdSpeakerName = "^s--^p" & UCase("PROSPECTIVE JUROR") & ": "
sqSpeakerName = "?^p" & UCase("PROSPECTIVE JUROR") & ": "
.Application.Selection.Find.ClearFormatting
.Application.Selection.Find.Replacement.ClearFormatting
With .Application.Selection.Find
.Text = ssSpeakerFind
.Replacement.Text = ssSpeakerName
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
.Application.Selection.Find.Execute Replace:=wdReplaceAll
.Application.Selection.Find.ClearFormatting
.Application.Selection.Find.Replacement.ClearFormatting
With .Application.Selection.Find
.Text = sdSpeakerFind
.Replacement.Text = sdSpeakerName
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
.Application.Selection.Find.Execute Replace:=wdReplaceAll
.Application.Selection.Find.ClearFormatting
.Application.Selection.Find.Replacement.ClearFormatting
With .Application.Selection.Find
.Text = sqSpeakerFind
.Replacement.Text = sqSpeakerName
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
.Application.Selection.Find.Execute Replace:=wdReplaceAll
If Not (x = 100 And x = 200) Then
Do Until x = 200
ssSpeakerFind = " snl" & x & " "
sdSpeakerFind = " dnl" & x & " "
sqSpeakerFind = " qnl" & x & " "
y = x - 100
ssSpeakerName = ".^p" & UCase("PROSPECTIVE JUROR NO. ") & y & ": "
sdSpeakerName = "^s--^p" & UCase("PROSPECTIVE JUROR NO. ") & y & ": "
sqSpeakerName = "?^p" & UCase("PROSPECTIVE JUROR NO. ") & y & ": "
.Application.Selection.Find.ClearFormatting
.Application.Selection.Find.Replacement.ClearFormatting
With .Application.Selection.Find
.Text = ssSpeakerFind
.Replacement.Text = ssSpeakerName
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
.Application.Selection.Find.Execute Replace:=wdReplaceAll
.Application.Selection.Find.ClearFormatting
.Application.Selection.Find.Replacement.ClearFormatting
With .Application.Selection.Find
.Text = sdSpeakerFind
.Replacement.Text = sdSpeakerName
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
.Application.Selection.Find.Execute Replace:=wdReplaceAll
.Application.Selection.Find.ClearFormatting
.Application.Selection.Find.Replacement.ClearFormatting
With .Application.Selection.Find
.Text = sqSpeakerFind
.Replacement.Text = sqSpeakerName
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
.Application.Selection.Find.Execute Replace:=wdReplaceAll
x = x + 1 'add 1 to x for next speaker name
Loop
Else
MsgBox "There are no prospective jurors to find/replace."
End If
End With
oCourtCoverWD.Save
oCourtCoverWD.Close
oWordApp.Quit
End Function