![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Capture com events I am working on controlling InternetExplorer object and some Microsoft Office objects. But I need to capture the events they generate. By doing: PS C:\> $a=New-Object -COM InternetExplorer.Application; PS C:\> $a.Navigate2("www.microsoft.com"); $a.visible=$true PS C:\> $a | get-member I can see there is no method to let me get to COM events generated by InternetExplorer.Application But if I do: PS C:\> $a=New-Object -COM Word.Application; $a.visible=$true PS C:\> $a | get-member | more I get things like: add_DocumentBeforeClose add_DocumentBeforePrint ………….. Evidently I can implement handlers for the events generated by Word.Application. The difference seems to be in the fact that later version of Microsoft Office come bundled with Primary Interop Assemblies (PIAs). But there is no PIA for Internet Explorer. Luckily we can generate Interop Assemblies ourselves by using tlbimp.exe or .NET libraries. My question is: isn’t there a simpler way? Something like WHS CreateObject(obj, eventPrefix), etc.? Any plans to have that in the future? Greg P.S. A quick fix solution for InternetExplorer object could be to have its PIAs distributed with PowerShell, but I guess there are security concerns with that. By the way, is there a place where one could find PIAs for Internet Explorer? |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Capture com events As I can see, no body 'touched' this message. I wonder, if you need reliable COM handling, going back to C++/VB is the only head-ache free solution? Greg "Greg Borota" <Greg Borota@discussions.microsoft.com> wrote in message news:1734CF6A-8925-477B-BDAE-3E1A779D4622@microsoft.com... >I am working on controlling InternetExplorer object and some Microsoft >Office > objects. But I need to capture the events they generate. > > By doing: > > PS C:\> $a=New-Object -COM InternetExplorer.Application; > PS C:\> $a.Navigate2("www.microsoft.com"); $a.visible=$true > PS C:\> $a | get-member > > I can see there is no method to let me get to COM events generated by > InternetExplorer.Application > > But if I do: > > PS C:\> $a=New-Object -COM Word.Application; $a.visible=$true > PS C:\> $a | get-member | more > > I get things like: > add_DocumentBeforeClose > add_DocumentBeforePrint ...... > > Evidently I can implement handlers for the events generated by > Word.Application. > > The difference seems to be in the fact that later version of Microsoft > Office come bundled with Primary Interop Assemblies (PIAs). But there is > no > PIA for Internet Explorer. Luckily we can generate Interop Assemblies > ourselves by using tlbimp.exe or .NET libraries. > > My question is: isn't there a simpler way? Something like WHS > CreateObject(obj, eventPrefix), etc.? Any plans to have that in the > future? > > Greg > > P.S. A quick fix solution for InternetExplorer object could be to have its > PIAs distributed with PowerShell, but I guess there are security concerns > with that. By the way, is there a place where one could find PIAs for > Internet Explorer? > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Can vbscript capture Word.Application events ? | VB Script | |||
| How can you capture individual thumbnails not full capture ? | Vista music pictures video | |||
| Wmi events | PowerShell | |||