Dim lstNum As New List(Of Integer)(New Integer() { 3, 6, 7, 9 })
When I type the above line of code, Visual Studio informs me of an error
'Microsoft.Office.Interop.Word.List' has no type parameters and so cannot have type arguments.
What on earth does that mean and how do I fix it? I can't seem to create lists of any kind. I'm assuming I'm missing some sort of import but I'm not fluent with VB.Net enough to know what to try.
Use Generic.List instead of just List.
Dim lstNum As New Generic.List(Of Integer)(New Integer() { 3, 6, 7, 9 })
Since you have the Word interop imported, it is trying to find Word.List. Specifying Generic.List will tell it to go outside of that import.
Try adding System.Collections.Generic
Dim lstNum As New System.Collections.Generic.List(Of Integer)(New Integer() { 3, 6, 7, 9 })
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With