1

I need to access Dictionary data type from Microsoft Word. I added the reference to scripting library, but Word has it's own Dictionary data type which I can't turn off or put it's priority lower. It confuses with desired Dictionary, so I decided to use this trick:

Sub Routine()
    Dim T
    T = CreateObject("Scripting.Dictionary")

    ' processing...
End Sub

It works, but I think the knowledge is power, and don't like late binding, so please tell me how to access Dictionary data type from Word.

Danatela
  • 349
  • 8
  • 28

1 Answers1

2

Using the full name of the class Scripting.Dictionary should resolve the ambiguity of which Dictionary class to consider.

Sub Routine()
    Dim d As Scripting.Dictionary
    Set d = New Scripting.Dictionary

    Debug.Print TypeName(d)
End Sub

In a way this is same as what you are doing while using CreateObject.

CS.
  • 766
  • 8
  • 24