IUccProperty.StringValue Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Gets and sets the string value of the property.

Namespace: Microsoft.Office.Interop.UccApi
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)

Syntax

'Declaration
Property StringValue As String
string StringValue { get; set; }
property String^ StringValue {
    String^ get ();
    void set (String^ value);
}
/** @property */
String get_StringValue ()

/** @property */
void set_StringValue (String value)
function get StringValue () : String

function set StringValue (value : String)

Property Value

A value of the BSTR* (string, for a .NET application) type. This returns the string value of the property.

Remarks

An application should verify that a given property is set before accessing the property. An application must enclose a reference to a property StringValue within a try/catch block to catch the COM exception raised when an un-initialized value property is accessed on the IUccProperty instance.

Win32 COM/C++ Syntax

HRESULT get_StringValue
(
   BSTR* pbstrPropertyValue
);
HRESULT put_StringValue
(
   BSTR pbstrPropertyValue
);

Note

In a Win32 application, the return value of a method or property is always an HRESULT value indicating the status of the call to the interface member. Any result of the operation is returned as a parameter marked with the [out, retval] attribute. In contrast, in a .NET application the HRESULT value indicating an error condition is returned as a COM exception and the [out, retval] parameter becomes the return value. For the Unified Communications Client API-defined HRESULT values, see Trace and Handle Errors in Unified Communications Client API.

Example

The following example returns a boolean value of true when the string property value of interest is initialized and a false value otherwise. The actual string value of the property is returned in an out parameter of the example method.

public Boolean GetPropertyStringValue(
   IUccPropertyCollection pPropertyCollection,
   int propertyId,
   out string propertyValue)
{
   //initialize return value
   Boolean returnValue = false;

   //initialize out value of interested property string value
   propertyValue = string.Empty;

   //verify interested property was set
   if (pPropertyCollection.IsPropertySet(propertyId))
   {
      //get interested property and fill returnValue with string value of property
      IUccProperty property = pPropertyCollection.get_Property(propertyId);
      try
      {
         returnValue = true;
         propertyValue = property.StringValue;
      }
      catch
      { }
   }
   return returnValue;
}

Thread Safety

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

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2000 with Service Pack 4, Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

See Also

Reference

IUccProperty Interface
IUccProperty Members
Microsoft.Office.Interop.UccApi Namespace