![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi all,
I want to automate various processes through outlook to the Shared Calendar in Sharepoint Services, using various bits of code I have found around...I have come up with the following very basic Sub and Function (where the meat is): every time I run it however I get error Number: -2147352567 with message: Invalid shared folder. can anyone help? I think I've done everything right, just can't get past the error... the specific lines = cro="stssync://tripleX/RBITCSPS/Lists/Calendar/calendar.aspx" Set MAPIFolder = MAPISession.OpenSharedFolder(cro, Null, Null, Null) Many thanks in advance regards Sean ' ' add a task/appointment to a calendar ' Sub tester() Dim x x = FnAddtoCalendar End Sub Public Function FnAddtoCalendar() As Boolean On Error GoTo ErrorHandler: Dim MAPISession As Outlook.NameSpace Dim MAPIFolder As Outlook.MAPIFolder Dim MAPIMailItem As Outlook.MailItem Dim blnSuccessful As Boolean Dim cro As String 'Get the MAPI NameSpace object Set MAPISession = Application.Session If Not MAPISession Is Nothing Then 'Logon to the MAPI session MAPISession.Logon , , True, False '***** cro = "stssync://tripleX/RBITCSPS/Lists/Calendar/calendar.aspx" Set MAPIFolder = MAPISession.OpenSharedFolder(cro, Null, Null, Null) '***** If Not MAPIFolder Is Nothing Then Set MAPIFolder = Nothing End If MAPISession.Logoff End If 'If we got to here, then we shall assume everything went ok. blnSuccessful = True ExitRoutine: Set MAPISession = Nothing FnAddtoCalendar = blnSuccessful Exit Function ErrorHandler: MsgBox "An error has occured in the user defined Outlook VBA function FnAddtoCalendar()" & vbCrLf & vbCrLf & _ "Error Number: " & CStr(Err.Number) & vbCrLf & _ "Error Description: " & Err.Description, vbApplicationModal + vbCritical Resume ExitRoutine End Function *** Sent via Developersdex http://www.developersdex.com *** |
Ads |
#2
|
|||
|
|||
![]()
This is a WebCal folder on SharePoint? Do you have permissions on the
folder? Why are you using that NameSpace logon? Outlook can't change logons when it's running. You also shouldn't be using NameSpace.Logoff. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Sean McPoland" wrote in message ... Hi all, I want to automate various processes through outlook to the Shared Calendar in Sharepoint Services, using various bits of code I have found around...I have come up with the following very basic Sub and Function (where the meat is): every time I run it however I get error Number: -2147352567 with message: Invalid shared folder. can anyone help? I think I've done everything right, just can't get past the error... the specific lines = cro="stssync://tripleX/RBITCSPS/Lists/Calendar/calendar.aspx" Set MAPIFolder = MAPISession.OpenSharedFolder(cro, Null, Null, Null) Many thanks in advance regards Sean ' ' add a task/appointment to a calendar ' Sub tester() Dim x x = FnAddtoCalendar End Sub Public Function FnAddtoCalendar() As Boolean On Error GoTo ErrorHandler: Dim MAPISession As Outlook.NameSpace Dim MAPIFolder As Outlook.MAPIFolder Dim MAPIMailItem As Outlook.MailItem Dim blnSuccessful As Boolean Dim cro As String 'Get the MAPI NameSpace object Set MAPISession = Application.Session If Not MAPISession Is Nothing Then 'Logon to the MAPI session MAPISession.Logon , , True, False '***** cro = "stssync://tripleX/RBITCSPS/Lists/Calendar/calendar.aspx" Set MAPIFolder = MAPISession.OpenSharedFolder(cro, Null, Null, Null) '***** If Not MAPIFolder Is Nothing Then Set MAPIFolder = Nothing End If MAPISession.Logoff End If 'If we got to here, then we shall assume everything went ok. blnSuccessful = True ExitRoutine: Set MAPISession = Nothing FnAddtoCalendar = blnSuccessful Exit Function ErrorHandler: MsgBox "An error has occured in the user defined Outlook VBA function FnAddtoCalendar()" & vbCrLf & vbCrLf & _ "Error Number: " & CStr(Err.Number) & vbCrLf & _ "Error Description: " & Err.Description, vbApplicationModal + vbCritical Resume ExitRoutine End Function *** Sent via Developersdex http://www.developersdex.com *** |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom fields with STSSync to Outlook | Munir | Outlook and VBA | 6 | December 8th 10 11:59 PM |
Sharepoint calendar + Outlook calendar (drag/drop) | P.Schuman | Outlook - Calandaring | 0 | September 11th 07 07:14 AM |
Event on STSSync? | Munir | Outlook and VBA | 1 | December 14th 06 01:36 PM |
Enable Outlook '02 XP calendar to link to sharepoint calendar | jnmkidd | Outlook - Calandaring | 1 | July 28th 06 04:24 AM |
How Outlook 2003 Stssync works | Pavel Shilov | Outlook - Using Contacts | 5 | March 15th 06 05:21 PM |