Share via


IUccPresenceNoteData Interface

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.

Encapsulates an individual note provided by a given user. IUccPresenceNoteInstance is obtained by a cast from IUccCategoryInstance where the category instance name is "note".

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

Syntax

'Declaration
Public Interface IUccPresenceNoteData
    Inherits IUnknown
public interface IUccPresenceNoteData : IUnknown
public interface class IUccPresenceNoteData : IUnknown
public interface IUccPresenceNoteData extends IUnknown
public interface IUccPresenceNoteData extends IUnknown

Remarks

This interface is used to represent a note item contained in an IUccPresenceNoteInstance object. An example of such note data is an Out Of Facility (OOF) note available to Microsoft Outlook messaging and collaboration client.

Win32 COM/C++ Syntax

interface IUccPresenceNoteData : IUnknown

Example

The following example creates a new instance of IUccPresenceNoteData using an instance of IUccPresenceNoteInstance as a factory.

/// <summary>
/// Creates a new note instance and adds the new instance to the Notes collection
/// of the IUccPresenceNoteInstance 
/// </summary>
/// <param name="content">Note text to add</param>
/// <param name="plcid">Location Id assigned to UccLocaleString instance</param>
/// <param name="noteType">type of note to add</param>
/// <param name="pNote">IUccPresenceNoteInstance note to add data to</param>
/// <returns></returns>
public Boolean AddNoteText(
    string content, 
    int plcid ,
    UCC_PRESENCE_NOTE_TYPE noteType,
    ref IUccPresenceNoteInstance pNote)
{
    Boolean returnValue = false;
    try
    {
        //create a new note
        UccPresenceNoteData newData = pNote.CreateNote(noteType);

        //use new note to create a UccLocaleSTring
        UccLocaleString localeString = newData.CreateContent();

        //assign note text to locale string
        localeString.String = content;

        //assign locale Id to locale string
        localeString.Lcid = plcid; 

        //assign locale string to note
        newData.Content = localeString;
        pNote.AddNote(newData);
        returnValue = true;
    }
    catch
    { }
    return returnValue;
}

The following example obtains IUccPresenceNoteData instances from a collection of notes on an IUccPresenceNoteInstance instance. The example accepts a note type in the first parameter position, and an IUccCategoryInstance of the name "note" in the second parameter position. You obtain an instance of IUccCategoryInstance for a given contact by advising for presentity, category context, and category instance events on the instance of IUccPresentity, IUccCategoryContext, and IUccCategoryInstance for the given contact. You must subscribe or query the publications of a contact before you can receive presentity, category context, or category instance for the contact.

        /// <summary>
        /// Gets a note of specified type from category instance published by remote user and subscribed locally
        /// </summary>
        /// <param name="noteType">UCC_PRESENCE_NOTE_TYPE. The type of note desired.</param>
        /// <param name="noteInstance">IUccCategoryInstance. The category instance of type "note"</param>
        /// <returns>string. The desired note</returns>
        public string GetContactNote(UCC_PRESENCE_NOTE_TYPE noteType, IUccCategoryInstance noteInstance)
        {
            IUccPresenceNoteInstance contactNote = noteInstance as IUccPresenceNoteInstance;
            StringBuilder sb = new StringBuilder();
            foreach (IUccPresenceNoteData noteDate in contactNote.Notes)
            {
                if (noteDate.Type == noteType)
                {
                    sb.Append(noteDate.Content.String);
                    sb.Append(System.Environment.NewLine);
                }
            }
            return sb.ToString();
        }

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

IUccPresenceNoteData Members
Microsoft.Office.Interop.UccApi Namespace