-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathOther_SpeechHelper.bas
104 lines (98 loc) · 3.53 KB
/
Other_SpeechHelper.bas
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
Attribute VB_Name = "Other_SpeechHelper"
Function CreateSound(xTextToSpeak As String)
Application.Speech.Speak xTextToSpeak, True
CreateSound = xTextToSpeak
End Function
Function SymbolToSpeakableName(zOfferID As String)
zInstrumentName = Range("SymbolIDForInstrument_" & zOfferID).Value
zInstrumentNameBase = Left(zInstrumentName, 3)
zInstrumentNameCounter = Right(zInstrumentName, 3)
' Any weird spelling is to help pronunciation
Select Case zInstrumentNameBase
Case "USD"
zInstrumentSpeakableNameBase = "Dollar"
Case "EUR"
zInstrumentSpeakableNameBase = "Euro"
Case "GBP"
zInstrumentSpeakableNameBase = "Pound"
Case "JPY"
zInstrumentSpeakableNameBase = "Yen"
Case "CHF"
zInstrumentSpeakableNameBase = "Swiss"
Case "AUD"
zInstrumentSpeakableNameBase = "Ozzie"
Case "NZD"
zInstrumentSpeakableNameBase = "Kiwi"
Case "CAD"
zInstrumentSpeakableNameBase = "Cad"
Case "SEK"
zInstrumentSpeakableNameBase = "SEK"
Case "NOK"
zInstrumentSpeakableNameBase = "NOK"
Case "MXN"
zInstrumentSpeakableNameBase = "Peso"
Case "PLN"
zInstrumentSpeakableNameBase = "Zloty"
Case "SGD"
zInstrumentSpeakableNameBase = "Sing"
Case "ZAR"
zInstrumentSpeakableNameBase = "Rand"
Case "CZK"
zInstrumentSpeakableNameBase = "Koruna"
Case "TRY"
zInstrumentSpeakableNameBase = "Lira"
Case "RUB"
zInstrumentSpeakableNameBase = "Ruble"
Case "DKK"
zInstrumentSpeakableNameCounter = "DKK"
Case Else
zInstrumentSpeakableNameBase = zInstrumentName
End Select
' Any weird spelling is to help pronunciation
Select Case zInstrumentNameCounter
Case "USD"
zInstrumentSpeakableNameCounter = "Dollar"
Case "EUR"
zInstrumentSpeakableNameCounter = "Euro"
Case "GBP"
zInstrumentSpeakableNameCounter = "Pound"
Case "JPY"
zInstrumentSpeakableNameCounter = "Yen"
Case "CHF"
zInstrumentSpeakableNameCounter = "Swiss"
Case "AUD"
zInstrumentSpeakableNameCounter = "Ozzie"
Case "NZD"
zInstrumentSpeakableNameCounter = "Kiwi"
Case "CAD"
zInstrumentSpeakableNameCounter = "Cad"
Case "SEK"
zInstrumentSpeakableNameCounter = "SEK"
Case "NOK"
zInstrumentSpeakableNameCounter = "NOK"
Case "MXN"
zInstrumentSpeakableNameCounter = "Peso"
Case "PLN"
zInstrumentSpeakableNameCounter = "Zloty"
Case "SGD"
zInstrumentSpeakableNameCounter = "Sing"
Case "ZAR"
zInstrumentSpeakableNameCounter = "Rand"
Case "CZK"
zInstrumentSpeakableNameCounter = "Koruna"
Case "TRY"
zInstrumentSpeakableNameCounter = "Lira"
Case "RUB"
zInstrumentSpeakableNameCounter = "Ruble"
Case "DKK"
zInstrumentSpeakableNameCounter = "DKK"
Case Else
zInstrumentSpeakableNameCounter = zInstrumentName
End Select
'Error handling for CFDs
If Not zInstrumentSpeakableNameBase = zInstrumentName Then
SymbolToSpeakableName = zInstrumentSpeakableNameBase & " " & zInstrumentSpeakableNameCounter & " "
Else
SymbolToSpeakableName = zInstrumentName
End If
End Function