Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > BOOK: Access 2010 VBA Programmer's Reference
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Access 2010 VBA Programmer's Reference
This is the forum to discuss the Wrox book Access 2010 Programmer's Reference by Teresa Hennig, Rob Cooper, Geoffrey L. Griffith, Jerry Dennison; ISBN: 978-0-470-59166-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Access 2010 VBA Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 21st, 2013, 01:14 PM
Registered User
Points: 34, Level: 1
Points: 34, Level: 1 Points: 34, Level: 1 Points: 34, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2011
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to display OutLook Calendar in MS Access 2010

I have some code from your Chap 18 section however I want to display in minimized form the OutLook Calendar for a date displayed in a text box. Using your code I can get the calendar to open and display the date selected but I can't get it to display "on top" of the current form in a minimized window i.e. I want to show the calendar next to the field on the form without covering the entire form.

Code:
Public Function GetOutLookCalendar(dtmDate As Date) As Date
On Error GoTo ErrorHandler
Const CALLER As String = " OutLook Mail:GetOutLookCalendar "

Dim dtResult As Date
Dim ol As New Outlook.Application
   Dim olns As Namespace
   Dim viw As Outlook.CalendarView
   
   Dim olCal As Outlook.MAPIFolder
   Dim olExp As Outlook.Explorer

     'get the OutLook Object and then calendar
   Set ol = GetObject(, "Outlook.Application")
   
   Set olns = ol.GetNamespace("MAPI")
   If ol.ActiveExplorer Is Nothing Then
       olns.GetDefaultFolder(olFolderCalendar).Display
   Else
       Set ol.ActiveExplorer.CurrentFolder = olns.GetDefaultFolder(olFolderCalendar)
       ol.ActiveExplorer.Display
 
   End If
   Set olExp = ol.ActiveExplorer.CurrentFolder.GetExplorer
   Set viw = olExp.CurrentView
   viw.GoToDate dtmDate
   dtResult = viw.DisplayedDates
Exit_Here:

Cleanup:
       On Error Resume Next
   Set ol = Nothing
   Set olns = Nothing
   Set olExp = Nothing
   Set viw = Nothing
   GetOutLookCalendar = dtResult
   Exit Function

   GetOutLookCalendar = Date
   Exit Function

ErrorHandler:
    Select Case Err.Number
        Case 429
            Set ol = CreateObject("Outlook.application")
           Resume Next
        Case Else
            MsgBox Err.Description & vbCrLf & _
             Err.Number & vbCrLf & _
            "Called By :" & CALLER & vbCrLf & _
            Err.Source, VbMsgBoxStyle.vbCritical, "Could not add new name to data base" & vbCrLf & _
                "Module Name: = " & MODULENAME
                dtResult = 1 / 1 / 1890
                
            GoTo Cleanup
    End Select
    


End Function
The next step would be to extract the calendar info i.e. subject, location and start and end time for ALL appointments on the date selected.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Access 2010 and Access Services with SP 2010 kmaford BOOK: Professional SharePoint 2010 Development 0 September 14th, 2010 04:25 PM
Send MS Outlook Calendar Entry From ASP.NET wackoyacky ASP.NET 2.0 Basics 0 June 17th, 2007 10:02 AM
Emailing from MS Access using vba and outlook katd007 Access VBA 0 July 8th, 2004 12:48 PM
Display Chinese from MS Access Database johnman Classic ASP Basics 1 May 25th, 2004 11:37 PM
Using Outlook Calendar in Access Ray Pinnegar Access VBA 2 October 27th, 2003 04:44 AM



All times are GMT -4. The time now is 08:05 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.