Sub modVar()
Dim dict As New Scripting.Dictionary
Dim filename As String
filename = "myfile.jpg"
dict.Add Right(filename, 3), ThisDocument.Path & filename
'msgbox dict["jpg"]
MsgBox ""
End Sub
Sub modVar()
Dim dict
Dim filename As String
Set dict = CreateObject(Scripting.Dictionary)
filename = "myfile.jpg"
dict.Add Right(filename, 3), ThisDocument.Path & filename
dict.Add Right(filename, 3), ThisDocument.Path
'msgbox dict["jpg"]
MsgBox ""
End Sub
Sub modVar()
Dim dict As Object
Dim filename As String
Set dict = CreateObject("Scripting.Dictionary")
filename = "myfile.jpg"
dict.Add Right(filename, 3), filename
MsgBox dict("jpg")
End Sub
~bp
Sub modVar()
Dim dict As Object
Dim filename As String
Dim file As String
Set dict = CreateObject("Scripting.Dictionary")
filename = "MyFile.jpg"
file = Right(filename, 3)
dict.Add file, filename
MsgBox dict(file)
End Sub
I am not sure how this will impact on my project as some of the variables are global.