By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,658 Members | 1,612 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,658 IT Pros & Developers. It's quick & easy.

Planting MS outlook 2003 in MS access form 2003

P: 222
Dear All ;

I would like to plant my inbox from MS OUTLOOK 2003 into an access form (2003).

Any IDEA for doing would be greatly appreciated.

Jul 10 '09 #1
Share this Question
Share on Google+
5 Replies

Expert 100+
P: 1,134
Design your form and the last icon on the toolbox window
is the "More Controls" tool. Click that and a window pops up.

Scroll down to "Microsoft Outlook View Control" and select it.
The window closes and you can then draw the control onto the form.

Save the form and run the form and you should see the contents of your inbox in the control you drew.

Note. Outlook will open in the background. All methods of accessing outlook from an Access form causes this, as far as I am aware. For example you can create an access object in VBA and use it to read through the emails (via VBA) in your inbox (or any other folder for that matter). This also causes Outlook to open!

Hope that helps
Jul 13 '09 #2

P: 222
Appreciate you. It works for 2003.

I would like to ask if the above scenario will work on office 2007 because I tried to insert "Microsoft Outlook View Control" it is replying "There is no object in this control" and I am not seeing my inbox I am only seeing a blank screen.

Any idea for office 2007.

Thank you for your time and consideration.

Jul 13 '09 #3

Expert 100+
P: 1,134
I don't use 2007 (HATE IT, HATE IT, HATE IT) so I can't say for the control.

I don't know what VBA skills you have but
you should, I imagine, be able to create an outlook object in vba in 2007.

You will need to go to the code window of your form and use the Tools/reference menu to add a reference to the
"Microsoft Outlook Object Library"
Using the outlook object you can loop through the emails in your inbox and list them into, say, list control.

There is lots of help but here's something to get you started
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.    Dim OlApp As Outlook.Application 
  3.    Dim Inbox As Outlook.MAPIFolder
  4.    Dim InboxItems As Outlook.Items
  5.    Dim Mailobject As Object
  6.    Dim str as string
  8.    'Create the objects
  9.    Set OlApp = CreateObject("Outlook.Application")
  10.    Set Inbox = OlApp.GetNamespace("Mapi").GetDefaultFolder(olFolderInbox)
  11.    Set InboxItems = Inbox.Items
  13.    InboxItems.Sort ReceivedTime, ascending 'sort the emails by date
  15.    'Loop through each email in the inbox and identify each one in a msgbox
  16.    For Each Mailobject In InboxItems
  17.       str="SUBJECT:-" & Mailobject.Subject & vblf & vbcr _
  18.          &"BODY:-" & Mailobject.Body & vblf & vbcr 
  19.       msgbox  str
  20.    next
  22.    'Release the objects
  23.    Set InboxItems = nothing
  24.    Set Inbox = nothing
  25.    Set OlApp = nothing
  26. end sub
Jul 13 '09 #4

P: 222
Thank you for your help.
Actually I hate access 2007 too. It is making my life complicated:S.

I do have only one issue regarding office 2003. Do you think I am able to plant the whole personal folder in access 2003 form. Here I mean not only my inbox I would like to let user see the sent item and all the folders that are in the inbox on MS outlook. Any method to point me to the right direction??

You are greatly appreciated man.

Jul 14 '09 #5

Expert 100+
P: 1,134
You can't change the folder from the controls properties.
You have to change it in VBA.
So in the form load event
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  3.    ViewCtl1.Folder = "Cabinet\Test"
  5.    ViewCtl2.Folder = "Calendar"
  6.    ViewCtl2.View = "Day/Week/Month"
  8.    ViewCtl3.Folder = "Sent Items"
  9. End Sub
notice that I have 3 outlook view controls on my form
the first one I have connected to a folder called Test in my cabinet
the second one I have connected to my calendar
the third one is connected to my sent items folder

Actually, thinking about it the control in 2007 may not have a default folder set to the inbox like it is in 2003 and thats why it is blank.
Jul 14 '09 #6

Post your reply

Sign in to post your reply or Sign up for a free account.