MartyConnelly
martyconnelly at shaw.ca
Thu Jun 22 13:25:16 CDT 2006
Not sure no longer have access to Exchange
I just have some notes on this
where exsess in this code would be
Set exsess = CreateObject("MAPI.Session")
http://windows.ittoolbox.com/groups/technical-functional/ms-exchange-l/accessing-the-public-folders-via-vb-104378
From here Get an Outlook default folder
http://www.cdolive.com/cdo5.htm
Here's a sample. You don't need the Public Folders\All Public Folders
string, you use the property tag for the public folders hierarchy:
Const PR_IPM_PUBLIC_FOLDERS_ENTRYID = &H66310102
Dim objCDO As MAPI.Session
Dim objFolder As MAPI.Folder
Dim objTopFolder As MAPI.Folder
Dim objInfoStores As MAPI.InfoStores
Dim objInfoStore As MAPI.InfoStore
Dim strRootID As String
Set objCDO = CreateObject("MAPI.Session")
objCDO.Logon "", "", False, False
' Get InfoStore collection
Set objInfoStores = objCDO.InfoStores
' Loop through the collection until we have found the public
information store
' Only this infostore will return the indicated property without error
For Each objInfoStore In objInfoStores
Err.Clear
strRootID = objInfoStore.Fields(PR_IPM_PUBLIC_FOLDERS_ENTRYID).Value
' Check for possible errors
If Err.Number = 0 Then
' Get root folder
Set objTopFolder = objCDO.GetFolder(strRootID, objInfoStore.ID)
Exit For
End If
Next
' Get your folder
Set objFolder = objTopFolder.Folders("Shared Contacts")
Rocky Smolin - Beach Access Software wrote:
>Marty:
>
>Thanks. Does the code in that first link assume that he has exposed the
>folder on exchange in his outlook? Or will it search all the public
>folders anywhere on the system?
>
>Rocky
>
>
>MartyConnelly wrote:
>
>
>> See http://www.outlookcode.com/d/code/getfolder.htm
>>and, especially for public folders,
>> http://www.outlookcode.com/codedetail.aspx?id=1164
>>More on the site.
>>
>>Rocky Smolin - Beach Access Software wrote:
>>
>>
>>
>>
>>>Charlotte:
>>>
>>>Thanks. I'll ask.
>>>
>>>Rocky
>>>
>>>
>>>Charlotte Foust wrote:
>>>
>>>
>>>
>>>
>>>
>>>>Is it a public folder? If so, he can expose it (assuming he has
>>>>permissions) in his outlook and you should be able to handle it like any
>>>>other Outlook folder. If he is working offline from Exchange server,
>>>>you have a problem.
>>>>
>>>>
>>>>Charlotte Foust
>>>>
>>>>-----Original Message-----
>>>>From: accessd-bounces at databaseadvisors.com
>>>>[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
>>>>- Beach Access Software
>>>>Sent: Thursday, June 22, 2006 8:15 AM
>>>>To: Access Developers discussion and problem solving
>>>>Subject: Re: [AccessD] Outlook Automation - rEDUX
>>>>
>>>>Well, thanks to list help I was able to see all of the folders in the
>>>>clients Outlook. Then he threw me a curve - the folder he really wants
>>>>to look at is in Exchange Server. I think. I don't really know never
>>>>having worked with Exchange Server. But is there an easy way to get to
>>>>those folders?
>>>>
>>>>Rocky
>>>>
>>>>
>>>>Rocky Smolin - Beach Access Software wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Dear List:
>>>>>
>>>>>I need to look in a specific outlook folder for mail. I can't find
>>>>>the syntax for this. Can anyone point me in the right direction?
>>>>>
>>>>>MTIA
>>>>>
>>>>>Rocky
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>--
>>>>Rocky Smolin
>>>>Beach Access Software
>>>>858-259-4334
>>>>www.e-z-mrp.com
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>
--
Marty Connelly
Victoria, B.C.
Canada