From: OldDog on 21 Jun 2010 12:30 On Jun 18, 6:45 pm, "mbyerley" <mDotByerley(a)VerizonDottieNettie> wrote: > I downloaded the SDK anyway. It looks like this was intended for a .NET > useage even though there is a reference to object instantiation using > JScript. For Script usage, it doesn't say to register the DLLs or how to > reference them. If I have time tomorrow, I'll look again, but if your > original code worked up to the point of p.MyContacts, you should trace your > code up to that point, then look at your p variable in the watch list and > walk its properties to see if you are exposing it or not. > > <gimme_this_gimme_t...(a)yahoo.com> wrote in message > > news:d113cdd9-2788-485e-b9ec-e3446163143f(a)q39g2000prh.googlegroups.com... > > > > > Good tip. > > > It's still fails on p.MyContacts... > > > Const MPHONE_TYPE_WORK = 1 > > > Sub showContacts() > > Dim p > > Dim s > > Dim t > > Dim o > > > Dim w > > Dim v > > v = 1 > > w = "" > > Set p = CreateObject("Communicator.UIAutomation") > > p.AutoSignin > > Set s = p.MyContacts > > > For v = 1 To s.count - 1 > > Set o = s.Item(v) > > Next > > > End Sub > > > showContacts()- Hide quoted text - > > - Show quoted text - I tried to do this in Powershell and it worked: #<------ Begin POSH script ---------------------------------------> Function showContacts{ $xl = new-object -comobject excel.application $xl.Visible = $true $xl.DisplayAlerts = $False $wb = $xl.Workbooks.Add() $ws = $wb.Worksheets.Item(1) $range = $ws.range("A1:B1") $range.font.bold = "true" $ws.Cells.Item(1,1) = "Friendly Name" $ws.Cells.Item(1,2) = "Sign in Name" $row = 2 $v = "" $w = "" $p = New-Object -comobject "Communicator.UIAutomation" $p.AutoSignin() $s = $p.MyContacts | ForEach-Object { $v = $_.FriendlyName $w = $_.SigninName $ws.Cells.Item($row,1) = $v $ws.Cells.Item($row,2) = $w $row++ } [void]$ws.cells.entireColumn.Autofit() } showContacts # < ------ end POSH script -------------------------------------------------> I had no trouble with the p variable. Not sure what vbScript is looking for here. Hope this helps. OldDog
From: gimme_this_gimme_that on 21 Jun 2010 22:54 This was a useful tip Old Dog. Thanks.
From: gimme_this_gimme_that on 21 Jun 2010 22:57 myerley. Confirm: Using Excel has two issues: 1. There is no clear cut way to add the "Office Communicator" object library to a dynamically created Workbook. 2. You can't enable VBA enable macro on a dynamically created Workbook. So it looks like a job for Powershell.
From: OldDog on 22 Jun 2010 10:09 On Jun 21, 9:54 pm, "gimme_this_gimme_t...(a)yahoo.com" <gimme_this_gimme_t...(a)yahoo.com> wrote: > This was a useful tip Old Dog. Thanks. Glad i could help. OldDog
First
|
Prev
|
Pages: 1 2 Prev: Reading XML objNode Value Next: PnPCapabilities, powermanagement and Windows 7 |