-
Notifications
You must be signed in to change notification settings - Fork 3
/
AcrobatGetNumPages
69 lines (56 loc) · 2.84 KB
/
AcrobatGetNumPages
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
Function AcrobatGetNumPages(sCourtDatesID)
'============================================================================
' Name : AcrobatGetNumPages
' Author : Erica L Ingram
' Copyright : 2019, A Quo Co.
' Call command: Call AcrobatGetNumPages(sCourtDatesID)
' Description : gets number of pages from PDF and confirms with you
'IS TOA ON SECOND PAGE?
'IF YES, MINUS TWO PAGES
'IF NO, MINUS ONE PAGE
'============================================================================
Dim dbAQC As Database
Dim qdf As QueryDef
Dim oAcrobatDoc As Object
Dim sTranscriptPDFPath As String, sActualQuantity1 As String, sActualQuantity As String
Dim sQuestion As String, sAnswer As String
Set oAcrobatDoc = New AcroPDDoc
sTranscriptPDFPath = "T:\In Progress\" & vCourtDatesID & "\" & vCourtDatesID & "-TRANSCRIPT-FINAL.pdf"
oAcrobatDoc.Open (sTranscriptPDFPath) 'update file location
sActualQuantity = oAcrobatDoc.GetNumPages
sQuestion = "This transcript came to " & sActualQuantity & " pages. Is the table of authorities on a separate page from the CoA?"
sAnswer = MsgBox(sQuestion, vbQuestion + vbYesNo, "???")
If answer = vbNo Then 'IF NO THEN THIS HAPPENS
MsgBox "Page count will be reduced by only one."
sActualQuantity = sActualQuantity - 1
sQuestion = "This transcript came to " & sActualQuantity & " billable pages. Is that page count correct?"
sAnswer = MsgBox(sQuestion, vbQuestion + vbYesNo, "???")
If sAnswer = vbNo Then 'IF NO THEN THIS HAPPENS
sActualQuantity1 = InputBox("How many billable pages was this transcript?")
sActualQuantity = sActualQuantity1
Else 'if yes then this happens
End If
Else 'if yes then this happens
MsgBox "Page count will be reduced by two."
sActualQuantity = sActualQuantity - 2
sQuestion = "This transcript came to " & sActualQuantity & " billable pages. Is that page count correct?"
sAnswer = MsgBox(sQuestion, vbQuestion + vbYesNo, "???")
If sAnswer = vbNo Then 'IF NO THEN THIS HAPPENS
sActualQuantity1 = InputBox("How many billable pages was this transcript?")
sActualQuantity = sActualQuantity1
Else 'if yes then this happens
sActualQuantity1 = InputBox("How many billable pages was this transcript?")
sActualQuantity = sActualQuantity1
End If
End If
oAcrobatDoc.Close
'"UPDATE CourtDates.ActualQuantity ON CourtDates.ID = " & vCourtDatesID & " SET CourtDates.ActualQuantity = " & sActualQuantity & ";"
Set dbAQC = CurrentDb
sSQL = "UPDATE [CourtDates] SET [CourtDates].[ActualQuantity] = " & sActualQuantity & " WHERE [CourtDates].[ID] = " & vCourtDatesID & ";"
Set qdf = dbAQC.CreateQueryDef("", sSQL)
dbAQC.Execute sSQL
Set qdf = Nothing
DoCmd.OpenQuery "FinalUnitPriceQuery" 'PRE-QUERY FOR FINAL SUBTOTAL
dbAQC.Execute "INVUpdateFinalUnitPriceQuery" 'UPDATES FINAL SUBTOTAL
dbAQC.Close
End Function