Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

opening outlook calendar from access form

Posted on 2008-10-29
10
549 Views
Last Modified: 2013-11-27
I'm no longer going to preface questions with "is it possible" - cuz I now know that almost anything is!! what I need to know now is how complicated would it be to open ms outlook directly to the calendar from a command button on an access form; and, would this be possible on a multi-user (splid) database environment where it would be difficult to modify each user's version of access or outlook (supplying files would not be hard because i have front-end updater software that could deliver it... but modifying settings within office apps would not be so practical) thanks!!
0
Comment
Question by:jpomerantz
  • 5
  • 5
10 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 22830834
Hi, jpomerantz.

It's not hard at all.  The code below opens the default calendar.  Add the code to a button's click event and you should be in business.
Const olFolderCalendar = 9
Dim olkApp, olkSes, olkFolder
On Error Resume Next
Set olkApp = GetObject(,"Outlook.Application")
If TypeName(olkApp) = "Nothing" Then
	Set olkApp = CreateObject("Outlook.Application")
	Set olkSes = olkApp.GetNameSpace("MAPI")
	'Change Outlook on the next line to the name of the default mail profile'
	olkSes.Logon "Outlook"
Else
	Set olkSes = olkApp.Session
End If
Set olkFolder = olkSes.GetDefaultFolder(olFolderCalendar)
olkFolder.Display
Set olkApp = Nothing
Set olkSes = Nothing
Set olkFolder = Nothing

Open in new window

0
 

Author Comment

by:jpomerantz
ID: 22832583
WOW!! that is so cool :) I can't thank you enough!!! for some reason though, it opens the calendar - but only if outlook is already open. if outlook is not open, nothing happens.  is there something to add to it to get it to first open outlook?
0
 
LVL 76

Expert Comment

by:David Lee
ID: 22832729
I included code to open Outlook if it isn't already open.  That's the code between the IF and ELSE.  Did you change the profile per the comment in the code?  Your profile may not be called Outlook.
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

Author Comment

by:jpomerantz
ID: 22833193
I didn't change anything in it - just cut and pasted it... I'm sort of a newbie and don't know about profiles... how do I know what my profile is? I do know that the school has it's own exchange server - I remote in using a vpn but most users will be on the network in the building... is there a way to figure out what the profile should be?
thank you so much!!
0
 
LVL 76

Expert Comment

by:David Lee
ID: 22834540
Here's how to check your profile name.

1.  Open the control panel
2.  Double-click the Mail icon
3.  Click the Show Profiles button
4.  Look at the "Always use this profile" selection at the bottom.  The name you see there is the name of the default profile.  It's typically "Outlook", but could be soemthing different.
0
 

Author Comment

by:jpomerantz
ID: 22834854
sure enough, the profile does say outlook... I wonder what is going on. I tried this on two computers and it's the same thing: if outlook is open already, the code opens the calendar - but if it's not - nothing happens.  any ideas?
I really appreciate this!!
0
 
LVL 76

Assisted Solution

by:David Lee
David Lee earned 500 total points
ID: 22836974
Replace line #5 with the line below

If TypeName(olkApp) <> "Application" Then
0
 

Author Closing Comment

by:jpomerantz
ID: 31511118
Works perfectly now!!! thank you so so so much :-)
0
 

Author Comment

by:jpomerantz
ID: 22839329
that did it! I can't thank you enough :-)
0
 
LVL 76

Expert Comment

by:David Lee
ID: 22839338
You're welcome.  Glad I could help!
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question