vbscript export calendar events
How do I use vbscript to get evetns out of a public calendar

Software/Hardware used:
ASKED: May 23, 2008  10:39 AM
UPDATED: May 30, 2008  3:57 PM

Answer Wiki:
Here is the VB Script: Function GetFolder(FolderPath) ' folder path needs to be something like ' "Public FoldersAll Public FoldersCompanySales" Dim aFolders Dim fldr Dim i Dim objNS On Error Resume Next strFolderPath = Replace(FolderPath, "/", "") aFolders = Split(FolderPath, "") 'get the Outlook objects ' use intrinsic Application object in form script Set objNS = Application.GetNamespace("MAPI") 'set the root folder Set fldr = objNS.Folders(aFolders(0)) 'loop through the array to get the subfolder 'loop is skipped when there is only one element in the array For i = 1 To UBound(aFolders) Set fldr = fldr.Folders(aFolders(i)) 'check for errors If Err <> 0 Then Exit Function Next Set GetFolder = fldr ' dereference objects Set objNS = Nothing End Function and this is the VBA: Public Function GetFolder(strFolderPath As String)As MAPIFolder ' strFolderPath needs to be something like ' "Public FoldersAll Public FoldersCompanySales" or ' "Personal FoldersInboxMy Folder" Dim objApp As Outlook.Application Dim objNS As Outlook.NameSpace Dim colFolders As Outlook.Folders Dim objFolder As Outlook.MAPIFolder Dim arrFolders() As String Dim I As Long On Error Resume Next strFolderPath = Replace(strFolderPath, "/", "") arrFolders() = Split(strFolderPath, "") Set objApp = Application Set objNS = objApp.GetNamespace("MAPI") Set objFolder = objNS.Folders.Item(arrFolders(0)) If Not objFolder Is Nothing Then For I = 1 To UBound(arrFolders) Set colFolders = objFolder.Folders Set objFolder = Nothing Set objFolder = colFolders.Item(arrFolders(I)) If objFolder Is Nothing Then Exit For End If Next End If Set GetFolder = objFolder Set colFolders = Nothing Set objNS = Nothing Set objApp = Nothing End Function
Last Wiki Answer Submitted:  May 30, 2008  3:57 pm  by  Karl Gechlik   9,815 pts.
All Answer Wiki Contributors:  Karl Gechlik   9,815 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Hello,
do you mean deleting the events or exporting them somewhere else?

 9,695 pts.