Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PS C:\Users\MYUSERNAME> $OneNote = New-Object -ComObject OneNote.Application
- PS C:\Users\MYUSERNAME> $binding = "System.Reflection.BindingFlags" -as [type]
- PS C:\Users\MYUSERNAME> $active_window = [System.__ComObject].InvokeMember("CurrentWindow", $binding::GetProperty, $null, $OneNote, $null)
- Exception calling "InvokeMember" with "5" argument(s): "Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))"
- At line:1 char:1
- + $active_window = [System.__ComObject].InvokeMember("CurrentWindow", $ ...
- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
- + FullyQualifiedErrorId : COMException
- PS C:\Users\MYUSERNAME> $active_window_pageId = [System.__ComObject].InvokeMember("CurrentPageId", $binding::GetProperty, $null, $active_window, $null)
- Exception calling "InvokeMember" with "5" argument(s): "Method 'System.__ComObject.CurrentPageId' not found."
- At line:1 char:1
- + $active_window_pageId = [System.__ComObject].InvokeMember("CurrentPag ...
- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
- + FullyQualifiedErrorId : MissingMethodException
- PS C:\Users\MYUSERNAME> Write-Output $active_window_pageId
- PS C:\Users\MYUSERNAME>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement