Results 1 to 4 of 4
  1. #1
    jaykappy is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2009
    Posts
    59

    Pass date and open outlook

    Is is possible to take a date from a varaible and build a string that will open Outlook Calendar and show that day in Outlook Calendar....


    Maybe an option to see the week as well?

    Anyone ever do this before? Possible?

    Thanks in Advance.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Google: vba open outlook calendar date

    Review
    http://www.officekb.com/Uwe/Forum.as...-date-with-VBA
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    jaykappy is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2009
    Posts
    59
    THanks June7....I was able to peice it together....I had to make a few changes as for some reason the Application I am working in would not except

    Dim objCalendar 'As Outlook.MAPIFolder
    Dim olExp 'As Outlook.Explorer

    I also had to add this: Const olFolderCalendar = 9

    WORKING CODE:

    Dim objCalendar
    Dim olExp

    Const olFolderCalendar = 9

    dtmMyDate = "05/05/2013"

    Set OL = CreateObject("Outlook.Application")
    Set olns = OL.GetNamespace("MAPI")
    Set objCalendar = olns.GetDefaultFolder(olFolderCalendar)
    objCalendar.Display
    Set olExp = objCalendar.GetExplorer
    Set viw = olExp.CurrentView
    viw.GoToDate dtmMyDate

  4. #4
    jaykappy is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2009
    Posts
    59
    Thanks for the site...read further and was able to test to see if outlook was open if so dont open again....

    CODE:

    Const olFolderCalendar = 9

    Dim objCalendar
    Dim olExp

    'dtmMyDate = Date + 30
    'dtmMyDate = "05/28/2010"
    dtmMyDate = txtAppointment

    Set OL = CreateObject("Outlook.Application")
    Set olns = OL.GetNamespace("MAPI")

    ' Test to determine if the Outlook window is already open
    ' If not open a new one, if so push changes to the one open
    If OL.ActiveExplorer Is Nothing Then
    Set objCalendar = olns.GetDefaultFolder(olFolderCalendar)
    objCalendar.Display
    Set olExp = objCalendar.GetExplorer
    Else
    Set objCalendar = olns.GetDefaultFolder(olFolderCalendar)
    Set OL.ActiveExplorer.CurrentFolder = objCalendar
    OL.ActiveExplorer.Display
    Set olExp = ol.ActiveExplorer.CurrentFolder.GetExplorer
    End If

    Set viw = olExp.CurrentView
    viw.GoToDate dtmMyDate

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 03-15-2012, 05:41 PM
  2. Replies: 1
    Last Post: 12-20-2011, 08:15 PM
  3. Open Outlook window but don't send
    By Paul Taylor in forum Access
    Replies: 2
    Last Post: 04-07-2011, 11:51 AM
  4. Open Outlook & populate e-mail
    By NISMOJim in forum Forms
    Replies: 7
    Last Post: 10-09-2010, 01:01 PM
  5. Open (shell) a program and pass a file
    By Olszanski in forum Programming
    Replies: 2
    Last Post: 07-27-2010, 03:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums