views:

263

answers:

1

Im trying to use the ComAutomationFactory class in VB .NET the example im working from is c# and is working fine but my project doesnt compile and says this class is not defined??

also what is the return type? in the c# example it returns a type of dynamic but this type does not exist in vb .NET?

+1  A: 

Possibly you're sample is old, according to this blog:

http://silverlight-essentials.blogspot.com/2010/03/breaking-changes-in-com-interop-between.html

It's changed name as:

The class ComAutomationFactory has been renamed to AutomationFactory. Additionally you have to reference System.Runtime.InteropServices.Automation for this class.

Regarding the return type, the answer to this question has a solution:

http://stackoverflow.com/questions/1976503/iterating-over-word-document-fields-using-comautomationfactory-in-silverlight-4

ho1
Thank you I will try this
keyoke