Export (0) Print
Expand All

XPathTypedValue Class

Office 2010

Implements the object returned by certain property values of the EmailSubmitConnection and FileSubmitConnection classes to get and set those values.

System.Object
  Microsoft.Office.InfoPath.XPathTypedValue

Namespace:  Microsoft.Office.InfoPath
Assembly:  Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)

public abstract class XPathTypedValue

An XPathTypedValue object is returned by the following members of the EmailSubmitConnection class to get or set their values:

An XPathTypedValue object is returned by the Filename property of the EmailSubmitConnection class to get or set its value.

To read or set these properties, you must use the properties and methods of the XPathTypedValue class.

You can set the value of a property that returns an XPathTypedValue object by specifying either a literal string or by specifying an XPath expression. Using an XPath expression allows you to set the property by retrieving the value from a field on that form (or some other node in the form's data sources). Additionally, you can use XPath operators and functions to perform other operations on the retrieved data.

To set the value of a property as a literal string, you use the SetStringValue method of the XPathTypedValue class.

The following example shows how to set the value of the To property of the EmailSubmitConnection class by specifying an e-mail address as a literal string using the SetStringValue method.

// Get the e-mail submit data connection configured for the form.
EmailSubmitConnection mySubmit = (EmailSubmitConnection)
   (this.DataConnections["Email Submit"]);

// Set To property to literal string value.
mySubmit.To.SetStringValue("someone@example.com");

// Submit form.
mySubmit.Execute();

To set the value of a property as an XPath expression, use the XPath property of the XPathTypedValue class.

The following example shows how to set the value of the To property of the EmailSubmitConnection class, by specifying an e-mail address as an XPath expression that retrieves the value from the ToAddress field on the form using the XPath property.

// Get the e-mail submit data connection configured for the form.
EmailSubmitConnection mySubmit = (EmailSubmitConnection)
   (this.DataConnections["Email Submit"]);

// Set To property to XPath for ToAddress field.
mySubmit.To.XPath = "/my:myFields/my:ToAddress";

// Submit form.
mySubmit.Execute();

To read values of properties returned as XPathTypedValue objects, use the Evaluate method of the XPathTypedValue class to evaluate an XPath expression and return its result as a string, or use the ToString method of the XPathTypedValue class to return a literal string.

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

Community Additions

ADD
Show:
© 2014 Microsoft