Jump to content
Sign in to follow this  
cookiemonster

Outlook _OL_FolderAccess

Recommended Posts

cookiemonster

Hey all

Got a folder access problem, its returning error4 extended 3, but im not sure why it cant find the calendar, any ideas?

#AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y
#include <OutlookEX.au3>

Global $oOutlook = _OL_Open()

Global $aFolder = _OL_FolderAccess($oOutlook, "*\\test\")
If @error <> 0 Then Exit MsgBox(16, "ERROR", "Error accessing folder @error = " & @error & @crlf & @extended)
Global $aFolderDisplay[6][2] = [[$aFolder[0]],["","Folder object"],["","Default item type for the folder"],["", "StoreID where the folder resides"],["", "EntryID of the folder"],["", "Folder path"]]
$aFolderDisplay[1][0] = $aFolder[1]
$aFolderDisplay[2][0] = $aFolder[2]
$aFolderDisplay[3][0] = $aFolder[3]
$aFolderDisplay[4][0] = $aFolder[4]
$aFolderDisplay[5][0] = $aFolder[5]
_ArrayDisplay($aFolderDisplay, "Folder 'test' successfully accessed.")

Share this post


Link to post
Share on other sites
cookiemonster

Is there a outlook OL to display all folders?

Share this post


Link to post
Share on other sites
water

Is there a outlook OL to display all folders?

_OL_FolderTree?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water
Global $aFolder = _OL_FolderAccess($oOutlook, "*\\test\")

When using this notation you need to pass the folder type too.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
cookiemonster

I still cant seem to access it.

This is a shared calendar im trying to access.

If I run _OL_FolderTree it only give me the list of my folders, doesnt show me this test calendar which is a shared one.

Ive managed to access shared calendars before but cant remember how I made it work, any more ideas?

Share this post


Link to post
Share on other sites
water

Does

Global $aFolder = _OL_FolderAccess($oOutlook, "xyz\\test\", $olFolderCalendar)

work?

xyz has to be replaced by the owner of the shared folder.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
cookiemonster

Yes that is working.... 

Now when im trying to create an appointment I get @error = 1, @extended: -2147352567

Share this post


Link to post
Share on other sites
water

Do you have the needed permissions? Can you manually create an appointment?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
cookiemonster

yeh I can create appointment manually.

ive put in a load of extra error message boxes and know it is currently getting folder access, then moves to create the item and fails _OL_ItemCreate with an error of 1 and extended 4:   4 - Error creating the item. @extended = error returned by the COM interface

Share this post


Link to post
Share on other sites
cookiemonster

Global $oOutlook = _OL_Open()


Global $aFolder = _OL_FolderAccess($oOutlook, "test\\calendar")
If @error <> 0 Then MsgBox(16, "1", "1.1. @error = " & @error)
If @error = 0 Then MsgBox(16, "1", "1.2 WORKING")

Global $oItem = _OL_ItemCreate($oOutlook, $olAppointmentItem, $aFolder, "", "Subject=" & GUICtrlRead($Name), "Start=" & $datetimestart, "End=" & $datetimeend, "MeetingStatus=1","Categories=On Call","BusyStatus=0")
If @error <> 0 Then MsgBox(16, "2", "2.1. @error = " & @error & "EXTENDED: " & @extended)
If @error = 0 Then MsgBox(16, "2", "2.2 WORKING")




_OL_Close($oOutlook)

Edited by cookiemonster

Share this post


Link to post
Share on other sites
water

Needs to be

Global $oItem = _OL_ItemCreate($oOutlook, $olAppointmentItem, $aFolder[1], "", "Subject=" & GUICtrlRead($Name), "Start=" & $datetimestart, "End=" & $datetimeend, "MeetingStatus=1","Categories=On Call","BusyStatus=0")

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
cookiemonster

Ah thats brilliant, I had that one in there before but must of changed it.

Ive looked through the outlookex lists and im trying to find a way to not be able to accept declines, essentially forcing the user to accept it, could you point me in the direction so i can give it a shot?

Share this post


Link to post
Share on other sites
water

That's a design flaw. Function _OL_FolderAccess should only return the folder object. All other information can be derived from that.  But now it's too late :(


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
cookiemonster

at least theres a work around, and it doesnt cause any harm :P

Share this post


Link to post
Share on other sites
water

Why do you want to send a meeting request without the possibility to be declined by the user?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
cookiemonster

Cause the appointment this is going to be booking in, they have to attend they can't decline it. So basically want to send it as an appointment that can on be accepted?

Share this post


Link to post
Share on other sites
water

I have no idea how this should be possible. Will check Google :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
cookiemonster

Ok cheers, ive also been googling but not found anything yet

Share this post


Link to post
Share on other sites
water

The only solution Google provides is to have an Outlook rule on the client side to automatically accept such meeting requests.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
cookiemonster

Yeh thats all I could find, oh well nevermind. Cheers for the help!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×