Sign in to follow this  
Followers 0
Wolfteeth

Office Communicator Conversation

6 posts in this topic

Not sure if someone used the AutoIt to generate converation in Office communicator 2007, I have tried below code, which can already start a new conversation window, but I am not sure how to send text to the conversation window as I don't know how to dim the data type in AutoIt. attach below is the c# code from MSDN,

http://msdn.microsoft.com/en-us/library/bb787199(office.12).aspx

$oCommunicator = ObjCreate("Communicator.UIAutomation")
$s = $oCommunicator.Mycontacts
$m = $oCommunicator.GetContact("soneone@dumy.com", $oCommunicator.MyServiceID)
$rr = $oCommunicator.InstantMessage($m)

and below should be VBA code:

Sub sendMessage()
Dim p As CommunicatorAPI.Messenger
Dim r As CommunicatorAPI.IMessengerConversationWndAdvanced
Dim s As CommunicatorAPI.IMessengerContacts
Dim m As CommunicatorAPI.IMessengerContact
Dim w As String
Dim v As Long
v = 1
w = ""
Set p = CreateObject("Communicator.UIAutomation")
p.AutoSignin
Set s = p.MyContacts
Set m = p.GetContact("some@dummy.com",CStr(p.MyServiceId))
Set rr = p.InstantMessage(m)
r.SendText ("hello from VBA Excel. ignore")
End Sub

Share this post


Link to post
Share on other sites



$oCommunicator = ObjCreate("Communicator.UIAutomation")
$s = $oCommunicator.Mycontacts
$m = $oCommunicator.GetContact("test@hp.com", $oCommunicator.MyServiceID)
$rr = $oCommunicator.InstantMessage($m)
Send("asdasdasdasdasdasdasdasd")
Send("{ENTER}")

This works and should get you started.

Share this post


Link to post
Share on other sites

$oCommunicator = ObjCreate("Communicator.UIAutomation")
$s = $oCommunicator.Mycontacts
$m = $oCommunicator.GetContact("test@hp.com", $oCommunicator.MyServiceID)
$rr = $oCommunicator.InstantMessage($m)
Send("asdasdasdasdasdasdasdasd")
Send("{ENTER}")

This works and should get you started.

Dear, this is not a good script even it can DO, I still want to use COM object behaviour for target.

Share this post


Link to post
Share on other sites

I tried it via AutoIt but it doesnt work. I think it is because it is restricted:

IMessengerConversationWndAdvanced::SendText
Sends a text message to an open conversation window.
[b]Not scriptable.[/b]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I tried it via AutoIt but it doesnt work. I think it is because it is restricted:

IMessengerConversationWndAdvanced::SendText
Sends a text message to an open conversation window.
[b]Not scriptable.[/b]

No, the Excel VBA code did the trick, for you reference too.

Sub Communicator()
Dim msgr As CommunicatorAPI.IMessengerConversationWndAdvanced
Set msgr = CommunicatorAPI.InstantMessage("me@me.com")
msgr.SendText "hello world"
End Sub

however, I don't want to use Excel to be the mediummedia but want to have an exe file so that I can use many other function build in Autoit to do more things.

by the way, you should add the reference for CommunicatorAutomation UI in advance.

I think the problem is that don't know how to hook the interface (CommunicatorAPI.IMessengerConversationWndAdvanced).

Below is the info from Object Browser:

Class IMessengerConversationWndAdvanced

Member of CommunicatorAPI

Messenger Conversation Window Advanced Interface

Class Messenger

Member of CommunicatorAPI

Messenger Object

Edited by Wolfteeth

Share this post


Link to post
Share on other sites

That is what i mean - it seems this function is not exposed outside the VBA.

In other words you cant access it with AutoIT. Maybe a DLL can be created to expose it but this is out of my expertise.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0