dumou8343

Creating outlook event in public calandar

14 posts in this topic

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!

Share this post


Link to post
Share on other sites



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

1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2016-07-20 - Version 1.2.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites

What is the value of @error after _OL_FolderAccess?

1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2016-07-20 - Version 1.2.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
2 minutes ago, water said:

What is the value of @error after _OL_FolderAccess?

1

Share this post


Link to post
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.

1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2016-07-20 - Version 1.2.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
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

 

Share this post


Link to post
Share on other sites

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

1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2016-07-20 - Version 1.2.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

OutlookEX 1.2.1.0 

autoit-v3.3.15.0

Share this post


Link to post
Share on other sites

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

 

1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2016-07-20 - Version 1.2.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

Glad you Like this UDF :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2016-07-20 - Version 1.2.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
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 :)

Share this post


Link to post
Share on other sites

Glad to be of service :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2016-07-20 - Version 1.2.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

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

  • Similar Content

    • rudi
      OutlookEX.UDF: send multiple attachmens in one go
      By rudi
      Hello.
      I'm trying to write a script to send multiple files using the local outlook installation (2007/2010/2013), to attach one or multiple files as attachment.
       
      As with the URL functionality the attachments never arrive in Outlook ("mailto:someone@company.com?subject=read-this&body=see-attachment&attachment=C:\temp\some-file.txt") I found the nice OutlookEx.UDF, but get lost.
       
       
      Here the readme https://www.autoitscript.com/wiki/OutlookEX_UDF_-_Mail_Item in the wiki describes, that it *IS* possible to send attachments, but I can't see an example howto handle single or multiple attachments.
       
      Where do I miss it?
       
      REgards ,Rudi.
    • Ligy
      OutlookEx Sending email from different email address
      By Ligy
      Hello everyone.
      Could you, please, help me with following problem?
      I need to send an email as different sender. The way "on behalf" does not fit me well enough. Much better for me would be something like declaring account credentials of the email i want to use and then use something like SendUsingAccount, but I am not able to figure out, how to get it from current OutlookEx.au3. Do you have any idea? Thanks a lot.
       
      Best Regards,
      Ligy
    • 9252Survive
      Help with OutlookEX - Sending Email/ Monitoring File
      By 9252Survive
      Hello, 
      I am trying to use the latest version of OutlookEx.au3 and my script is able to send the email to the user first time but second time I am getting this error (see attached) I am trying to check a file every min and verify if the file has been modified, if the file was not modified then an email is sent. It works for the first time but fails in the second iteration. Also, attaching my code, I am very new to AutoIT, any help would be much appreciated! 

      Thanks! 
       
       
      #AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y #include <MsgBoxConstants.au3> #include <Debug.au3> #include <File.au3> #include <WinAPI.au3> #include <GuiComboBox.au3> #include <Date.au3> #include <AutoItConstants.au3> #include <Array.au3> #include <Process.au3> #include <StringConstants.au3> #include <FileConstants.au3> ; include for file functions #include <WinAPIFiles.au3> #include <_SingleScript.au3> #include <WinNet.au3> #include <Timers.au3> #include <INet.au3> #include <OutlookEX.au3> #include <DateCalc.au3> #Region AutoIT_Options Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=No case Opt("WinSearchChildren", 1) ;0=no, 1=search children also Opt("TrayIconDebug", 1) ;0=no info, 1=debug line info Opt("TrayAutoPause", 0) ; 0 = no pause , 1 = pause when tray icon is clicked #EndRegion AutoIT_Options Global $logFileName = "Test" & "-" & @YEAR &"_"&@MON& "." & "log" Global $logfile = @ScriptDir &"\"& $logFileName Global $LastModTime Global $LastModTime Global $LastModTimeStamp Global $FiletoCheck_1 Global $FiletoCheck_2 Global $oOutlook = _OL_Open() Func _SendAlert() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) ;Global $sCurrentUser = $oOutlook.GetNameSpace("MAPI").CurrentUser.Name ;_OL_Wrapper_SendMail($oOutlook, $sCurrentUser, "", "", "Travel Time Calc Engine ALERT! ", "An error has occurred, the log file has not changed since: " & $LastModTimeStamp, "", $olFormatHTML, $olImportanceHigh _OL_Wrapper_SendMail($oOutlook, "testemail@gmail.com", "", "", "ALERT! ", "An error has occurred, the log file has not changed since: " & $LastModTimeStamp, "", $olFormatHTML, $olImportanceHigh) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Error sending mail. @error = " & @error & ", @extended: " & @extended) ;MsgBox(64, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Mail successfully sent to user '" & $sCurrentUser & "'!") _OL_Close($oOutlook) EndFunc Func _ChecklogFile() $FiletoCheck_2 = FileGetTime($logfile, 0, 1) ; Timestamp If $FiletoCheck_1 == $FiletoCheck_2 Then ; if the time stamp has not changed Msgbox("","","File has not changed") _SendAlert() Else Msgbox("","","File has changed") EndIf EndFunc ; Initial Launch, grab current GetTime $FiletoCheck_1 = FileGetTime($logfile,0,1) Local $YYYY = StringLeft ( $FiletoCheck_1, 4 ) Local $MM = StringMid ( $FiletoCheck_1,5,2) Local $DD = StringMid ( $FiletoCheck_1,7,2 ) Local $HH = StringMid ( $FiletoCheck_1,9,2 ) Local $Min = StringMid ( $FiletoCheck_1,11,2 ) Local $SS = StringMid ( $FiletoCheck_1,13,2 ) $LastModTimeStamp = $YYYY&"-"&$MM&"-"&$DD&" "&$HH&":"&$Min&":"&$SS While 1 Sleep(60000) ; check every 10 mins _ChecklogFile() WEnd  

    • water
      OutlookEX UDF - add functions for "conversations"?
      By water
      Is anyone interested in functions to work with Outlook "conversations"?
      You should be able to gather and manipulate items (mails, appointments etc.) which belong to the same conversation.
    • hazed6809
      _ol_folderAccess crashes outlook2013
      By hazed6809
      upgrading a older script that worked on outlook 2010 that is causing me issues on 2013
      I have a shared mailbox called "NED-ASSET MANAGEMENT" and I want to access the "INBOX of it"
      $oOutlook = _OL_Open(True)
      $mailbox = "NED-ASSET MANAGEMENT"
      $aFolder = _OL_FolderAccess($oOutlook, StringStripWS($mailbox, 3) & "\INBOX")
       
      the error I get is
      "C:\Program Files (x86)\AutoIt3\Include\OutlookEX.au3" (1269) : ==> The requested action with this object has failed.:
      $oFolder = $oNamespace.Folders($aFolders[1])
      $oFolder = $oNamespace^ ERROR
      I am stubbed at what the issue is.