dotNET
dotNET

Reputation: 35440

Converting BSTR to String[]

I can see a number of google results for converting string array to BSTR, but none that does it the other way around. How do I do that?

Details

I'm using VSTO + C# for writing a Word add-in. One of the functions of Word Object Model named SynonymInfo.get_SynonymList() appears to return a strange data type that I cannot iterate over (foreach fails). There is no way of getting the upper bound or length of the array either. People use this function in VBA with UBound(), which unfortunately isn't there in C#. I searched further and found that the data type of this function is BSTR.

The function itself is defined as dynamic in VSTO, so I can't really see what members are there in it. Even the QuickWatch window doesn't show any members, even though it can successfully list down the array elements.

Upvotes: 0

Views: 326

Answers (0)

Related Questions