Help Copy Public Folder Calander Items to Personal Calendar(code sample) 
Author Message
 Help Copy Public Folder Calander Items to Personal Calendar(code sample)

Sub CopyCalendar()
Dim olNs, oFolder, oItems, oItem, CopyItem
Set olNs = Application.GetNamespace("MAPI")
Set oFolder = olNs.Folders("Public Folders").Folders("All Public
Folders").Folders("Bill's Appts")
Set oItems = oFolder.Items
Set oItem = oItems.GetFirst
Do While Not (oItem Is Nothing)
    Set CopyItem = oItem.Copy
    CopyItem.Move olNs("Calander")
    Set oItem = oItems.GetNext
Loop
End Sub


Wed, 11 Feb 2004 00:57:38 GMT  
 Help Copy Public Folder Calander Items to Personal Calendar(code sample)
Sub CopyCalendar()
Dim olNs, oFolder, oItems, oItem, CopyItem, objInbox, DefaultStoreRoot,
tfolder
Set olNs = Application.GetNamespace("MAPI")
Set oFolder = olNs.Folders("Public Folders").Folders("All Public
Folders").Folders("Bill's Appts")
Set objInbox = olNs.GetDefaultFolder(olFolderInbox)
Set DefaultStoreRoot = objInbox.Parent
Set tfolder = DefaultStoreRoot.Folders("Calendar")

Set oItems = oFolder.Items
Set oItem = oItems.GetFirst

Do While Not (oItem Is Nothing)
    Set CopyItem = oItem.Copy
    CopyItem.Move tfolder
    Set oItem = oItems.GetNext
Loop

End Sub

Quote:
> Sub CopyCalendar()
> Dim olNs, oFolder, oItems, oItem, CopyItem
> Set olNs = Application.GetNamespace("MAPI")
> Set oFolder = olNs.Folders("Public Folders").Folders("All Public
> Folders").Folders("Bill's Appts")
> Set oItems = oFolder.Items
> Set oItem = oItems.GetFirst
> Do While Not (oItem Is Nothing)
>     Set CopyItem = oItem.Copy
>     CopyItem.Move olNs("Calander")
>     Set oItem = oItems.GetNext
> Loop
> End Sub



Wed, 11 Feb 2004 01:20:22 GMT  
 Help Copy Public Folder Calander Items to Personal Calendar(code sample)

Brian,
Could you write the code so that it copied from a specific public calendar to all users(calendars) on the server.
I am trying to put a company calendar on our private calendars.  But I also need to be able to do updates to those appointments.
Can you provide any help with this?
Pat

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sat, 17 Apr 2004 23:44:10 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Unread Items in Public Folders like in personal Folders

2. Copy public calendar items to private calendars

3. Copy calendar to Public Folder

4. protecting a public folder from copying an item

5. Need sample code for read public folder contact into access

6. Macro to sync personal and public calendar

7. Differentiation between public and personal folders.

8. Outlook 98 - Personal and Public Task Folder

9. Accessing Personal and Public folders via CDO object

10. Copy old mail to new personal folder w/VBA

11. Can't sort Outlook Personal Folder using Items.Sort

12. Tricky! Listing Resources Calendars in a Public Folder

 

 
Powered by phpBB® Forum Software