Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Choose date to display on calendar (Outlook 2003 VBA)

    At the completion of an existing macro that inserts appointments into Outlook's calendar I need to be able to have the calendar display a particular day. I'm sure this is obvious once you know how but I understand Outlook automation about as well as I comprehend those beings who hail from Venus!!
    I can use an Inspector object to display a specific appointment - but that does not show me the rest of the day. I can use the "Display" method on a MAPIFolder object to display a new Calendar window but that just shows the day that the user last chose (or today if the user has not done anything with the calendar).
    Any help appreciated

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Choose date to display on calendar (Outlook 2003 VBA)

    Try this code (in the example, the date 30 days from today is selected):

    Set ActiveExplorer.CurrentFolder = GetNamespace("MAPI").GetDefaultFolder(olFolderCale ndar)
    ActiveExplorer.CurrentView.GoToDate Date + 30

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Choose date to display on calendar (Outlook 2003 VBA)

    Hans, that is fantastic! Thank you soooo much. What I didn't say is that I wanted a new window opened for that day, but from your response I figured that I could use GetExplorer to create a new window and display that.
    Getting really picky, I didn't want the new window to show the folder list. After more hunting through the help file I found the ShowPane method. The obvious thing seemed to be to get the Explorer, use ShowPane to hide the folder list and then call display - except that doesn't hide the folder list! Out of sheer desperation I switched the order of display and show pane as follows...
    myExplorer.Display
    myExplorer.ShowPane olFolderList, False
    ... and it works!
    Now that I have the answer I can sort of understand that ShowPane shows and hides things within an object and that might only make real sense if the object is already being displayed. It all just seems a wee bit subtle to me.
    Enough ranting, thanks again for your help you definitely saved me from hours in my blind alley!!
    Cheers
    Ian

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •