"Lisa in The Lowcountry" <Lisa in The (e-mail address removed)>
schrieb im Newsbeitrag
Can an Outlook 2003 Note be made to stay on screen, on top of what ever
windows are open?
With a little VBA Code (Extras/Macro/Visual Basic Editor)
'[In ThisOutlookSession]
Option Explicit
Private WithEvents m_Inspectors As Inspectors
Private m_ThreadID As Long
Private Sub Application_StartUp()
m_ThreadID = GetCurrentThreadId
Set m_Inspectors = Application.Inspectors
End Sub
Private Sub Application_Quit()
Set m_Inspectors = Nothing
End Sub
Private Sub m_Inspectors_NewInspector(ByVal Inspector As Inspector)
If TypeOf Inspector.CurrentItem Is NoteItem Then g_Hook =
SetWindowsHookEx(WH_CBT, AddressOf WndProc, 0&, m_ThreadID)
End Sub
'[/In ThisOutlookSession]
'[In a module]
Option Explicit
Public Declare Function SetWindowsHookEx Lib "user32" _
Alias "SetWindowsHookExA" (ByVal idHook As Long, _
ByVal lpfn As Long, ByVal hmod As Long, ByVal _
dwThreadId As Long) As Long
Public Declare Function GetCurrentThreadId Lib "kernel32" () _
As Long
Private Declare Function UnhookWindowsHookEx Lib "user32" _
(ByVal hHook As Long) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _
ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal
cx As Long, _
ByVal cy As Long, ByVal wFlags As Long) As Long
Public Const WH_CBT = 5
Private Const HCBT_ACTIVATE = 5
Private Const HWND_TOPMOST As Long = -1
Private Const SWP_NOSIZE As Long = &H1
Private Const SWP_NOMOVE As Long = &H2
Public g_Hook As Long
Public Function WndProc(ByVal uMsg As Long, ByVal wParam As Long, ByVal
lParam As Long) As Long
If uMsg = HCBT_ACTIVATE Then
Call SetWindowPos(wParam, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or
SWP_NOMOVE)
UnhookWindowsHookEx g_Hook
End If
WndProc = False
End Function
'[/In a Module]
Hope this helps
Matthias