Jump to content
Sign in to follow this  
albertmaathuis

Apointment in outlook

Recommended Posts

Hi There,

I'm trying to make an appointment  in one of my outlook agenda's not beeing the default agenda (normally calendar)

At home I'm using office 365 (3 agenda's: calendar, main and albert
At work in a exchange outlook environment its : Albert Maathuis and Company

I would like to acces any agenda and make an appointment from autiIT.

For the default agenda (home this is calendar; at work this is Albert Maathuis) everything works fine, but making an appointment in the agenda albert (at home) or Company (at work) I cannot get it done. 
Below is the code that doesn't give any errors, but only puts the appointment in the "calendar"and not in the calendar named "albert"

Anyone having suggestions?

$objOL = ObjGet("", "Outlook.Application")
_OL_FolderAccess($objOL,"\info@les7anges.com\albert")
$agenda = $objOL.CreateItem ($olAppointmentItem)
$agenda.Location = "location"
$agenda.Subject = "Appointment made by me"
$agenda.Body = "Extra information"
$agenda.Start = _Now()
$agenda.Duration = 60
$agenda.Save

 

Share this post


Link to post
Share on other sites

@albertmaathuis have you looked at water's great Outlook UDF (below))? I use _OL_ItemCreate to create appointments.

 

 


"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites

Why don't you just create it manually, why are you trying to automate something like this? It's a simple task that hardly needs repetition.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

@JLogan3o13: Thanks for your reply, I already looked in his UDF and tried some things, but everything came in the default agenda, perhaps I made some mistakes...

I will try your proposal of _OL_Itemcreate again.

@BrewManNH: The reason is the following: I want to make not only one appointment. In the software I start with one date and the software is then generating follow-up dates.

There will be at least 5 follow-ups, with different kind of intervals and in different agenda's 

So basicly I need to know how to make an appointment in the agenda of someone else (normally a shared agenda) on a specific time en date.

Share this post


Link to post
Share on other sites

Which function did you check?

  • _OL_Wrapper_CreateAppointment: This is a simplified wrapper with limited features so people using the original Outlook UDF didn't need to rewrite their scripts.
  • _OL_ItemCreate: This - plus additional functions - should help you solve your issue.
    Have a look at example script _OL_ItemCreate.au3. There is an appointment example that shows how to specify a calendar where to create the appointment.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-09-05 - Version 1.5.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - 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
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

.. or if any problems arise ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-09-05 - Version 1.5.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - 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
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

Yes, problems did arise.

I succeeded in making appointments in my own calendar, a shared calendar on my laptop and also making an appointment in my own calendar on the companies network (Exchange and outlook).
The thing I cannot get to work is making an appointment in the calendar of a colleague in the exchange environment at work.
I have rights to make an appointment, but I don't know how to acces his map. (This is also not visible when I go to his calendar and display his calendar settings)

This is the simple version of then program up to now:

#include <OutlookEX.au3>

Global $oOutlook = _OL_Open()
Global $calender_to_acces

;TEST-1
;$calender_to_acces=""
; works for the default calendar in a local outlook environment (office 365, outlook 2016, the calendar name = "calendar"
; works for the default calendar in a network environment (exchange, outlook 2016, the calendar name = "e-mail adres of the currentuser"


;TEST-2
;$calender_to_acces="*\main_agenda\sub agenda\Albert agenda"
; works for a specified calendar in a local outlook environment (office 365, outlook 2016,the calendar name = Albert agenda"

$calender_to_acces = InputBox("test", "Name of the agenda", "", "",- 1, -1, 0, 0)

$oItem = _OL_ItemCreate($oOutlook, $olAppointmentItem, $calender_to_acces, "", "Subject=TestSubject", "Start=" & _NowCalc(), "End=" & _DateAdd("h", 1, _NowCalc()))

If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemCreate Example Script", "Error creating an appointment in folder "&$calender_to_acces&". @error = " & @error & ", @extended = " & @extended)

_OL_Close($oOutlook)

 

After the test-1 and test-2 I tried to acces the company calendar by puting in the inputbox:
*\company --company ---\\company --\company --*\company\ -- company@companyname.com and so on, but nothings works.

On the internet I found a VBA code, but I cannot get it to work / replace it in AutoIT (see the attached file)

Perhaps you can help me with this?

 

 

VBA creating appointment in other user.pdf

Share this post


Link to post
Share on other sites

Here you find some documentation on how to access folders (local/public/...).
After successfully calling _OL_FolderAccess pass $aFolder[1] to _OL_itemCreate.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-09-05 - Version 1.5.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - 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
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

Wow, it works!!

Added:

$calendarname=InputBox("inputname","")
$aFolder = _OL_FolderAccess($oOutlook, $calendarname, $olFolderCalendar)
$calender_to_acces=$aFolder[1]

and put the name in like this: \\company\

Thanks very much for your time and help!

Share this post


Link to post
Share on other sites

Glad you like the UDF ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-09-05 - Version 1.5.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - 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
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - 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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...