for in olFolderCalendar

  • Thread starter Thread starter Sylfelin
  • Start date Start date
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
 
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.
 
Back
Top