A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Accessing a Mailbox



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 22nd 07, 01:14 AM posted to microsoft.public.outlook.program_vba
Andy Jax
external usenet poster
 
Posts: 5
Default Accessing a Mailbox

There is an "Other Calendar" option named Master Schedule. It is not in the
public folder tree, it is an individual user mailbox in the system. I need to
access the items and process against the schedules.

Dim emlSecond As MailItem
Dim nsMyNameSpace As NameSpace
Dim fdrInbox As MAPIFolder
Set nsMyNameSpace = Application.GetNamespace("MAPI")
Set fdrInbox = nsMyNameSpace.GetSharedDefaultFolder("Master Schedule",
olFolderInbox)
Set emlSecond = fdrInbox.Items.Item(5)
MsgBox "Second e-mail : " & vbCrLf & vbCrLf & emlSecond.Subject & vbCrLf &
emlSecond.Body

Gives a type mismatch at "Master Schedule". How do I access the mailbox items?
Ads
  #2  
Old May 22nd 07, 01:39 AM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Accessing a Mailbox

GetSharedDefaultFolder method takes the Recipient object (such as the one
returned by Namespace.CreateRecipient) as the first parameter.
Do you have the Outlook VBA help file installed?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Andy Jax" wrote in message
...
There is an "Other Calendar" option named Master Schedule. It is not in
the
public folder tree, it is an individual user mailbox in the system. I need
to
access the items and process against the schedules.

Dim emlSecond As MailItem
Dim nsMyNameSpace As NameSpace
Dim fdrInbox As MAPIFolder
Set nsMyNameSpace = Application.GetNamespace("MAPI")
Set fdrInbox = nsMyNameSpace.GetSharedDefaultFolder("Master Schedule",
olFolderInbox)
Set emlSecond = fdrInbox.Items.Item(5)
MsgBox "Second e-mail : " & vbCrLf & vbCrLf & emlSecond.Subject & vbCrLf &
emlSecond.Body

Gives a type mismatch at "Master Schedule". How do I access the mailbox
items?



  #3  
Old May 22nd 07, 05:50 PM posted to microsoft.public.outlook.program_vba
Andy Jax
external usenet poster
 
Posts: 5
Default Accessing a Mailbox

Thank you for the CreateRecipient. This is where my error was.

"Andy Jax" wrote:

There is an "Other Calendar" option named Master Schedule. It is not in the
public folder tree, it is an individual user mailbox in the system. I need to
access the items and process against the schedules.

Dim emlSecond As MailItem
Dim nsMyNameSpace As NameSpace
Dim fdrInbox As MAPIFolder
Set nsMyNameSpace = Application.GetNamespace("MAPI")
Set fdrInbox = nsMyNameSpace.GetSharedDefaultFolder("Master Schedule",
olFolderInbox)
Set emlSecond = fdrInbox.Items.Item(5)
MsgBox "Second e-mail : " & vbCrLf & vbCrLf & emlSecond.Subject & vbCrLf &
emlSecond.Body

Gives a type mismatch at "Master Schedule". How do I access the mailbox items?

 




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing mailbox with outlook library The Facilitator Outlook and VBA 5 March 30th 07 08:18 PM
Accessing another Exchange mailbox SteveB Outlook and VBA 2 June 15th 06 01:46 PM
Accessing email in an Exchange 5.5 mailbox via VBScript? [email protected] Outlook and VBA 1 May 24th 06 11:43 PM
Accessing shared mailbox from outlook 2003 using IMAP [email protected] Outlook - General Queries 1 May 4th 06 10:09 PM
Exchange Mailbox server prohibit from sending when reach mailbox size limit Milly Staples [MVP - Outlook] Outlook - General Queries 1 February 24th 06 07:41 PM


All times are GMT +1. The time now is 11:15 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.