FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

Call Notifier checking Outlook Contacts - Done
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows
View previous topic :: View next topic  
Author Message
vwmomo
Newbie


Joined: 23 Aug 2007
Posts: 5

PostPosted: Thu May 08, 2008 4:14 am    Post subject: Still workin on it Reply with quote

So I got the timer thing working so it shows longer but it still only says Call from unknown number. Now do I need outlook 07 running for this to work or need to show the directory where I have it installed? I changed the file type to .VBS and also changed the xml to look for .VBS instead of .js This is my script so far

[code:1]function CallStatusChanged( theTerminal, theCallStatus, thePhoneNumber, theCallType, theCID )

'On Error Resume Next

Const olFolderContacts = 10
Const Title = "Incoming call from "
Dim arrContacts (1000)
Dim arrLength, ItemCount

Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set colContacts = objNamespace.GetDefaultFolder(olFolderContacts).Items

If theCallStatus = 7 Then
If Not thePhoneNumber = "" Then
ItemCount = 0
For Each objContact In colContacts
line = objContact.HomeTelephoneNumber & objContact.BusinessTelephoneNumber & objContact.MobileTelephoneNumber
dline = Replace (line, " ", "")
line = objContact.FullName & "_" & dline
arrContacts(ItemCount)= line
ItemCount = ItemCount +1
Next

SearchString = thePhoneNumber
For Each InputItem In arrContacts
TempString = InputItem
If InStr(TempString, SearchString) > 0 Then
pos = InStr(TempString, "_")
displayString = Left(TempString, pos-1)
'WScript.Echo displayString
End If
Next
displayString = Title & displayString
Else
displayString = Title & " unknown number"
End If
Call ShowMessage (displayString , NoIcon, -1, 2000)
End If

End Function
[/code:1]
Back to top
View user's profile Send private message
frrik
Newbie


Joined: 16 Apr 2008
Posts: 2

PostPosted: Sun May 18, 2008 10:28 pm    Post subject: Reply with quote

Well, the issue seems to be that the objContact doesn't contain either of those fields at all - is there any way of checking that it is of the expected type to begin with?

Sorry I have no experience with hacking the Outlook 2007 SDK (yeah, it's 2007 I run) so I'm being a bit lost here... :-)
Back to top
View user's profile Send private message
marcelo
Newbie


Joined: 29 Sep 2008
Posts: 1

PostPosted: Mon Sep 29, 2008 5:01 pm    Post subject: Reply with quote

[quote="frrik"]Well, the issue seems to be that the objContact doesn't contain either of those fields at all - is there any way of checking that it is of the expected type to begin with?

Sorry I have no experience with hacking the Outlook 2007 SDK (yeah, it's 2007 I run) so I'm being a bit lost here... :-)[/quote]

This problem may occur if you have objects that are not a ContactItem in your Contact List (for example a distribution list).

I’ve changed the script to fix this and to use just one loop (to give a fast response). I think this might solve your problem:


[code:1]function CallStatusChanged( theTerminal, theCallStatus, thePhoneNumber, theCallType, theCID )

'On Error Resume Next

Const olFolderContacts = 10
Const Title = "Chamada de "

Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set colContacts = objNamespace.GetDefaultFolder(olFolderContacts).Items

If theCallStatus = 7 Then
If Not thePhoneNumber = "" Then
For Each objContact In colContacts
If TypeName(objContact) = "ContactItem" Then
Line = objContact.HomeTelephoneNumber & objContact.BusinessTelephoneNumber & objContact.MobileTelephoneNumber '& objContact.Business2TelephoneNumber & objContact.Home2TelephoneNumber
dline = Replace(Line, " ", "")
dline = Replace(dline, "-", "")
Line = objContact.FullName & "_" & dline

SearchString = thePhoneNumber
If InStr(Line, SearchString) > 0 Then
pos = InStr(Line, "_")
displayString = Left(Line, pos - 1)
Exit For
End If

End If
Next

displayString = Title & displayString

Else
displayString = Title & " Número Desconhecido"
End If
Call ShowMessage (displayString , NoIcon, -1, 8000)
End If

End Function [/code:1]
Back to top
View user's profile Send private message
accelrate
Newbie


Joined: 20 Jul 2009
Posts: 1

PostPosted: Mon Jul 20, 2009 8:50 am    Post subject: Installation? Reply with quote

I like the idea of this script, except I just don't know how to install it. Some help would be appreciated. Thanks
Back to top
View user's profile Send private message
cmatte
Newbie


Joined: 19 Aug 2007
Posts: 10

PostPosted: Sun Oct 11, 2009 7:54 pm    Post subject: Reply with quote

I tried putting the code into "C:\Program Files (x86)\Salling Software AB\Salling Clicker\Default Scripts\CallNotifier\CallNotifier.js" substituting the whole stuff there.
What I get is NO messages and the mobile phone saying any call is from a private number, which is not true :shock:
What did I do wrong?

Please give us an help :oops:
Back to top
View user's profile Send private message MSN Messenger
madindehead
Junior Member


Joined: 17 Jan 2007
Posts: 25

PostPosted: Thu Jan 14, 2010 2:06 pm    Post subject: Reply with quote

How exactly do we get this to work?

Do you just copy and paste it into a new script?
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows All times are GMT + 2 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group