Export (0) Print
Expand All

ComAutomationFactory Class

[Note: This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Provides access to registered Automation servers.

Namespace:  System.Windows.Interop
Assembly:  System.Windows (in System.Windows.dll)

public static class ComAutomationFactory

The Silverlight-based application plays the role of an Automation client and can directly access the programming model and services exposed by the Automation server.

To access an Automation server, you should first check the IsAvailable property. Then, you can use the CreateObject or GetObject method to retrieve a late-bound reference to the Automation server. To use the reference as a late-bound object, you must assign it to a variable of type Object in Visual Basic and type dynamic in C#.

For more information about Automation, see Automation.

The following example demonstrates how to use this class.

dynamic outlook = 
    ComAutomationFactory.CreateObject("Outlook.Application");
dynamic mailItem = outlook.CreateItem(0);
mailItem.To = "johndoe";
mailItem.Subject = "Silverlight 4 Automation Test";
mailItem.HTMLBody = "<P>test message</P>";
mailItem.Display();

System.Object
  System.Windows.Interop.ComAutomationFactory

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Show:
© 2014 Microsoft