A
Andrew
I currently have some code that opens a new message to a
contact. I am trying to have it add multiple contacts,
but the AddContact method, is just bringing up the dialog
to select a contact with that particular contact
selected. I tried playing with the SendKeys to send the
Enter key and include that person. Besides my not liking
hacks like SendKeys it doesn't seem to always work and
haven't got it to work for a 3rd person. Any thoughts
would much be appreciated. Here is my code.
'Code Starts Here*******************************
On error resume next
Dim MsgrUIA
Dim msgContact
Dim msgContact2
Dim msgContact3
Dim msgContact4
Const sEmail = "(e-mail address removed)"
Const sEmail2 = "(e-mail address removed)"
Const sEmail3 = "(e-mail address removed)"
Const sEmail4 = "(e-mail address removed)"
Set MsgrUIA = CreateObject("Messenger.UIAutomation.1")
Set msgContact = MsgrUIA.GetContact(sEmail,"")
Set msgContact2 = MsgrUIA.GetContact(sEmail2,"")
Set msgContact3 = MsgrUIA.GetContact(sEmail3,"")
Set msgContact4 = MsgrUIA.GetContact(sEmail4,"")
Set myMessage = MsgrUIA.InstantMessage(msgContact)
If Not IsObject(myMessage) Then
MsgBox("You are not signed in.")
Else
'Add other contacts to this conversation
myMessage.AddContact(msgContact2)
set oShell = CreateObject("WScript.Shell")
oShell.SendKeys"{ENTER}"
oShell.SendKeys"{ENTER}"
MyMessage.AddContact(msgContact3)
oShell.SendKeys"{ENTER}"
oShell.SendKeys"{ENTER}"
MyMessage.AddContact(msgContact4)
oShell.SendKeys"{ENTER}"
End If
On Error GoTo 0
contact. I am trying to have it add multiple contacts,
but the AddContact method, is just bringing up the dialog
to select a contact with that particular contact
selected. I tried playing with the SendKeys to send the
Enter key and include that person. Besides my not liking
hacks like SendKeys it doesn't seem to always work and
haven't got it to work for a 3rd person. Any thoughts
would much be appreciated. Here is my code.
'Code Starts Here*******************************
On error resume next
Dim MsgrUIA
Dim msgContact
Dim msgContact2
Dim msgContact3
Dim msgContact4
Const sEmail = "(e-mail address removed)"
Const sEmail2 = "(e-mail address removed)"
Const sEmail3 = "(e-mail address removed)"
Const sEmail4 = "(e-mail address removed)"
Set MsgrUIA = CreateObject("Messenger.UIAutomation.1")
Set msgContact = MsgrUIA.GetContact(sEmail,"")
Set msgContact2 = MsgrUIA.GetContact(sEmail2,"")
Set msgContact3 = MsgrUIA.GetContact(sEmail3,"")
Set msgContact4 = MsgrUIA.GetContact(sEmail4,"")
Set myMessage = MsgrUIA.InstantMessage(msgContact)
If Not IsObject(myMessage) Then
MsgBox("You are not signed in.")
Else
'Add other contacts to this conversation
myMessage.AddContact(msgContact2)
set oShell = CreateObject("WScript.Shell")
oShell.SendKeys"{ENTER}"
oShell.SendKeys"{ENTER}"
MyMessage.AddContact(msgContact3)
oShell.SendKeys"{ENTER}"
oShell.SendKeys"{ENTER}"
MyMessage.AddContact(msgContact4)
oShell.SendKeys"{ENTER}"
End If
On Error GoTo 0