There's two things wrong.
First, you must remove the Dim
keyword. The Using
keyword replaces the Dim
keyword. Both Dim
and Using
have the same effect of declaring a new variable, just in different ways.
Secondly, you must remove parentheses. The very first thing after the Using
keyword must be the variable name.
Using doc As WordprocessingDocument = WordprocessingDocument.Open(filename, True)
' blah blah
End Using