Jump to content

Creating outlook event in public calandar


Recommended Posts

Hey guys, I wanted to write this in the outlookEX thread but it was locked.

 

I'm currently trying to get a script to write to a public calandar and I can't figure out how to tell autoit to write to the public calandar on the network,

 

I currently have this witch works like I need it to but it writes in my personal calandar, can I make this write in the public one? I didn't find anything in the outlookEX help files

#Include <OutlookEX.au3>

Global $sStart = StringLeft(_Nowcalc(),16)
Global $sEnd   = StringLeft(_DateAdd("h", 3, _NowCalc()), 16)
Global $oOutlook = _OL_Open()
_OL_Wrapper_CreateAppointment($oOutlook, "TestMeeting", $sStart, $sEnd, "My office", False, "Testbody", 15, $olBusy, $olImportanceHigh, $olPrivate, $olRecursWeekly, $sStart, _DateAdd("w", 3, $sEnd), 1)

Thanks guys!

Link to comment
Share on other sites

Sure.
You need to use _OL_FolderAccess to access the public folder and replace _OL_Wrapper* with _OL_ItemCreate.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Hey water, Thanks for the help! 

 

I've been playing around and reading the help files for _OL_FolderAccess and _OL_ItemCreate, but the meeting still shows up in my own calander,

Here is what I got now

Global $oOutlook = _OL_Open()
Global $aFolder = _OL_FolderAccess($oOutlook, "\\Dossiers publics - xxxx.xxxxxxxxx@xx.xx.xx.xx\Tous les dossiers publics\Secteur Opérations Régionales\Région\Réservation Pont Visio")
_OL_ItemCreate($oOutlook, $olAppointmentItem, $aFolder)
\\Dossiers publics - xxxx.xxxxxxxxx@xxxx.xxxx.xx.xx\Tous les dossiers publics\Secteur Opérations Régionales\Région

 is the full path and 

Réservation Pont Visio

is the name of the calandar 

 

Everything works great except for that last part, so I'm guessing I'm not setting the folder path correctly...

Link to comment
Share on other sites

What is the value of @error after _OL_FolderAccess?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Means: $iFolderType is missing or not a number

Try:

Global $oOutlook = _OL_Open()
Global $aFolder = _OL_FolderAccess($oOutlook, "\\Dossiers publics - xxxx.xxxxxxxxx@xx.xx.xx.xx\Tous les dossiers publics\Secteur Opérations Régionales\Région\Réservation Pont Visio", $olFolderCalendar)
Global $oItem = _OL_ItemCreate($oOutlook, $olAppointmentItem, $aFolder[1])

I added the foldertype to _OL_FolderAccess and passed item 1 of $aFolder to _OL_ItemCreate because _OL_FolderAccess returns an array.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

4 minutes ago, water said:

Means: $iFolderType is missing or not a number

Try:

Global $oOutlook = _OL_Open()
Global $aFolder = _OL_FolderAccess($oOutlook, "\\Dossiers publics - xxxx.xxxxxxxxx@xx.xx.xx.xx\Tous les dossiers publics\Secteur Opérations Régionales\Région\Réservation Pont Visio", $olFolderCalendar)
Global $oItem = _OL_ItemCreate($oOutlook, $olAppointmentItem, $aFolder[1])

I added the foldertype to _OL_FolderAccess and passed item 1 of $aFolder to _OL_ItemCreate because _OL_FolderAccess returns an array.

Now I am getting an error and no event are created anywhere

"C:\Users\xxxxxx\Desktop\autoit\OutlookEX.au3" (1275) : ==> The requested action with this object has failed.:
$oFolder = $oFolder.Folders($aFolders[$iIndex])
$oFolder = $oFolder^ ERROR
>Exit code: 1    Time: 0.405

 

Link to comment
Share on other sites

Which version of AutoIt do you run?
Which version of the OutlookEx UDF do you run?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

BTW: To access a public folder you need to drop the leading "\\" as described here:

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

1 minute ago, water said:

BTW: To access a public folder you need to drop the leading "\\" as described here:

 

OMG THAT WORKS!

 

Thank you soo much! I can continue my program now I've been trying to get to write to this calandar for months! you are a rock star!

Link to comment
Share on other sites

Glad you Like this UDF :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

It is really helpfull I made a program for my users to create support tickets and send it via email. Everyone likes the program and its really better then needing to always open outlook to write the ticket! discovering autoit and this UDF made my job more fun and also easier :)

Link to comment
Share on other sites

Glad to be of service :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

×
×
  • Create New...