D
deko
I have an Access 2003 app running on Vista that opens the Outlook Calendar
like this:
Set olapp = New Outlook.Application
Set olns = olapp.GetNamespace("MAPI")
olns.GetDefaultFolder(olFolderCalendar).display
'hide the navigation pane
Set olxp = olapp.ActiveExplorer
olxp.ShowPane olNavigationPane, False
The problem is the calendar window opens behind the Access application
window.
Is there any way to ensure the Outlook Calendar opens on top?
I've tried a few things but none seem to work. For example:
olapp.ActiveWindow 'no help
Using the Windows API like this:
Private Declare Function FindWindow _
Lib "user32" Alias "FindWindowA" (ByVal lpclassname As String, _
ByVal lpWindowName As String) As Long
Private Declare Sub BringWindowToTop _
Lib "user32" (ByVal HWND&)
Public Function ShowOutlook()
Dim HWND As Long
HWND = FindWindow(vbNullString, "Calendar - Microsoft Outlook")
BringWindowToTop HWND
is there a easier way?
Thanks in advance.
like this:
Set olapp = New Outlook.Application
Set olns = olapp.GetNamespace("MAPI")
olns.GetDefaultFolder(olFolderCalendar).display
'hide the navigation pane
Set olxp = olapp.ActiveExplorer
olxp.ShowPane olNavigationPane, False
The problem is the calendar window opens behind the Access application
window.
Is there any way to ensure the Outlook Calendar opens on top?
I've tried a few things but none seem to work. For example:
olapp.ActiveWindow 'no help
Using the Windows API like this:
Private Declare Function FindWindow _
Lib "user32" Alias "FindWindowA" (ByVal lpclassname As String, _
ByVal lpWindowName As String) As Long
Private Declare Sub BringWindowToTop _
Lib "user32" (ByVal HWND&)
Public Function ShowOutlook()
Dim HWND As Long
HWND = FindWindow(vbNullString, "Calendar - Microsoft Outlook")
BringWindowToTop HWND
is there a easier way?
Thanks in advance.