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> foreach ($window in $OneNote.Windows) {
- >> $page_id = [System.__ComObject].InvokeMember("CurrentPageId", $binding::GetProperty, $null, $window, $null)
- >> Write-Output $page_id
- >> }
- Exception calling "InvokeMember" with "5" argument(s): "Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))"
- At line:2 char:3
- + $page_id = [System.__ComObject].InvokeMember("CurrentPageId", $bind ...
- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
- + FullyQualifiedErrorId : COMException
- Exception calling "InvokeMember" with "5" argument(s): "Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))"
- At line:2 char:3
- + $page_id = [System.__ComObject].InvokeMember("CurrentPageId", $bind ...
- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
- + FullyQualifiedErrorId : COMException
- Exception calling "InvokeMember" with "5" argument(s): "Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))"
- At line:2 char:3
- + $page_id = [System.__ComObject].InvokeMember("CurrentPageId", $bind ...
- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
- + FullyQualifiedErrorId : COMException
- Exception calling "InvokeMember" with "5" argument(s): "Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))"
- At line:2 char:3
- + $page_id = [System.__ComObject].InvokeMember("CurrentPageId", $bind ...
- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
- + FullyQualifiedErrorId : COMException
- Exception calling "InvokeMember" with "5" argument(s): "Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))"
- At line:2 char:3
- + $page_id = [System.__ComObject].InvokeMember("CurrentPageId", $bind ...
- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
- + FullyQualifiedErrorId : COMException
- Exception calling "InvokeMember" with "5" argument(s): "Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))"
- At line:2 char:3
- + $page_id = [System.__ComObject].InvokeMember("CurrentPageId", $bind ...
- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
- + FullyQualifiedErrorId : COMException
- Exception calling "InvokeMember" with "5" argument(s): "Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))"
- At line:2 char:3
- + $page_id = [System.__ComObject].InvokeMember("CurrentPageId", $bind ...
- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
- + FullyQualifiedErrorId : COMException
- PS C:\Users\MYUSERNAME>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement