for in olFolderCalendar

S

Sylfelin

Hello,

for active the view of other calendar i use this code.

Set myOlApp = CreateObject("Outlook.Application")

Set myNms = myOlApp.GetNamespace("MAPI")
Set myFolder = myNms.GetDefaultFolder(olFolderCalendar)

Set myExplorer = myOlApp.ActiveExplorer
Set myExplorer.CurrentFolder = myFolder


Set myRecipient = myNms.CreateRecipient("Gilles")
Set SharedFolder = myNms.GetSharedDefaultFolder(myRecipient,
olFolderCalendar)
myExplorer.SelectFolder SharedFolder

Set myRecipient = myNms.CreateRecipient("Eric")
Set SharedFolder = myNms.GetSharedDefaultFolder(myRecipient,
olFolderCalendar)
myExplorer.SelectFolder SharedFolder

But for optimize the code, i would find the recipient list .

Can i do it ?

This code is not functionnaly:

'''' For Each myRecipient In myFolder.Items
'''' Debug.Print myRecipient.Name
'''' Next myRecipient

Thank's
 
K

Ken Slovak - [MVP - Outlook]

For Each myItem In myFolder.Items
Set colRecipients = myItem.Recipients
For Each myRecipient In colRecipients
Debug.Print myRecipient.Name
Next
Next

That will fire the security prompts however if you are running non-trusted
code or code in the VBA project for versions of Outlook less than 2003. See
http://www.outlookcode.com/d/sec.htm for information about the security
model.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top