locked
Send IM to multiple destinations RRS feed

  • Question

  •  

    Hi,

     

    I wanna send I IM to multiple destinations but I can´t have them organized on groups. How can I do this with performance? any sample?

     

    Help is really appreciated!

     

    Tks,

    DD

    Tuesday, October 16, 2007 2:54 PM

All replies

  • If dealing with a client and dont mind the communicator UI running (I'd like to know how to do it w/o using the communicator UI!!),

    this has sample code:

    C:\Program Files\Microsoft Office Communicator\SDK\OCSDK.chm

     

    "Starting an Instant Messaging Conversation":

    I just made an object array and skipped the use the arraylist they mention. 

    vb:   Dim sips As Object() = {"r", "t", "o"}

    Code Block
    //load selected contacts into ArrayList.
    ArrayList contactArray =  new ArrayList()
    contactArray.Add("jaya@contoso.com");
    contactArray.Add("joshP@contoso.com"};
    
    //dimension object array to the number of contacts selected
    object[] sipUris = new object[contactArray.Count];
    int currentObject = 0;
    
    //iterate over contactArray and load each individual
    //contact into object array element.
    foreach (object contactObject in contactArray)
    {
        sipUris[currentObject] = contactObject;
        currentObject ++;
    }
    
    long windowHandle;
    
    CommunicatorAPI.IMessengerAdvanced msgrAdv =
    communicator as CommunicatorAPI.IMessengerAdvanced;
    if (msgrAdv != null)
    {
        try
        {
            object obj = msgrAdv.StartConversation(
                       CONVERSATION_TYPE.CONVERSATION_TYPE_IM,
                       sipUris, // object array of signin names
                       null,
                       "Testing",
                       "1",
                       null);
            windowHandle = long.Parse(obj.ToString());
        }
        catch (COMException ex)
        {
            this.writeToTextBox(
                    formReturnErrors.returnComError(ex.ErrorCode)
        );
    }
    

     

     

    Wednesday, October 17, 2007 8:38 PM